• Vimのfoldexprで新たに折り畳みを定義する方法とその活用法

    Vimで十分に活用されていない組み込み機能の一つは折り畳み(Folding)だと思います。私は以前から折り畳みをいくつかの方法で活用しており、Vimのお気に入りの機能の一つになっています。この記事では、私がどのように折り畳みを設定しているのか、さらには折り畳みを活用するためのプラグインについてみなさんに共有します。

  • A keyboard-oriented system tray for X11 tiling window managers

    Typically, tiling window managers like XMonad do not have a system tray. If you want a system tray, you can use a standalone implementation like stalonetray or a status bar implementation with built-in system tray support, such as polybar.

  • Why you should use wcwidth() to calculate a character width

    Character width depends on the font, and Unicode Consortium does not provide explicit width definitions for all characters. There are characters that have ambiguous widths other than those defined as "Ambiguous (A)" in EastAsianWidth.txt. For example, "☀ (U+2600)" is defined as "Neutral (N)" in EastAsianWidth.txt, but its width may be full-width in a CJK font or an emoji font. This means that a non-East Asian character may be also the ambiguous-width character. Character width tables in default locales is problematic for both CJK and non-CJK users. You can create a custom locale to define a better character width table. wcwidth() respects defined by the locale. All TUI applications should consistently use wcwidth() to calculate the width of the character without an embedded character width table. If there is a mismatch in character width between applications, the screen will be broken.

  • XMonadでカスタマイズ可能なマルチカラムレイアウトを

    XMonadで3列以上のレイアウトを提供するモジュールとして、xmonad-contribのThreeColumnsとMultiColumnsが存在する。ThreeColumnsは3列固定のレイアウトで、MultiColumnsは列数が動的に増減するレイアウトだ。しかし、いずれのレイアウトも筆者の要求を満たすものではなく、新しいレイアウトを独自に作成するに至った。

  • 調和の取れたカラーパレット生成をデザインシステムに向けて

    近年、サービス全体の一貫性を確保するためにデザインシステムを構築する例が多い。この時、特に難しいのがカラーパレットの設計で、その理由は以下のような要件があるからだ。

  • PC版ニコニコ生放送に映像の左右反転ボタンを

    ニコ生の配信アプリでは、フロントカメラの映像はデフォルトで左右反転しています。これは配信者からすると映像は鏡のように見えるので自然ですが(女性の場合は盛れるので反転してるケースも)、視聴者の側からすると文字の判別が困難だったり、車の運転席が逆に見える等の理由で、違和感を抱きます。そのため、フロントカメラが左右反転していると、度々「反転直せ」コメが走ります。

  • メモリ効率の良いテンプレートエンジンの実装をPHPで

    PHPのWebアリプケーションではHTMLを描画するためにテンプレートエンジンが良く使われる。テンプレートエンジンは与えられたテンプレート文字列と変数を元に結果を描画する。この時、描画結果が文字列であるなら、少なくとも文字列の長さだけメモリ空間を必要とする。

View All Articles →