Terminalの見た目を維持してAlacrittyを導入したよ


経緯

ずっとTerminalを使用してきたのですが、「Alacritty早くて良いよ!」って聞いたので使ってみることにしました。

AlacrittyのGithubは下記
https://github.com/jwilm/alacritty

やりたい事

Alacrittyを導入するが、Terminalと見た目を同じにする。

インストール

Githubに載っているとおりです。

brew cask install alacritty

ほぼこれで終わりなのですが、私の環境だと日本語のファイル名などが表示されない問題がありました。
.bash_profileに下記を追加したら解決しました。

.bash_profile
export LANG=ja_JP.UTF-8

設定ファイル更新

~/.config/alacritty/alacritty.ymlを更新します。

フォントを変える

TerminalのフォントがMonaco 11 pt.だったのでそれに合わせます。
font以下にfamily: Monacoを追加

alacritty.yml
font:
  # Normal (roman) font face
  normal:
    # Font family
    #
    # Default:
    #   - (macOS) Menlo
    #   - (Linux) monospace
    #   - (Windows) Consolas
    # family: monospace
+    family: Monaco

    # The `style` can be specified to pick a specific face.
    style: Regular

  # Bold font face
  bold:
    # Font family
    #
    # If the bold family is not specified, it will fall back to the
    # value specified for the normal font.
    # family: monospace
+    family: Monaco

    # The `style` can be specified to pick a specific face.
    style: Bold

  # Italic font face
  italic:
    # Font family
    #
    # If the italic family is not specified, it will fall back to the
    # value specified for the normal font.
    # family: monospace
+    family: Monaco

    # The `style` can be specified to pick a specific face.
    style: Italic

  # Point size
  size: 11.0

カラースキームを変更する

もともとSolarized Darkを使用していたので。
ここからカラースキームをコピーしてきてのcolors以下に貼り付けます。

alacritty.yml
colors:
-  # Default colors
-  primary:
-    background: '0x000000'
-    foreground: '0xeaeaea'
-
-    # Bright and dim foreground colors
-    #
-    # The dimmed foreground color is calculated automatically if it is not present.
-    # If the bright foreground color is not set, or `draw_bold_text_with_bright_colors`
-    # is `false`, the normal foreground color will be used.
-    #dim_foreground: '0x9a9a9a'
-    #bright_foreground: '0xffffff'
-
-  # Cursor colors
-  #
-  # Colors which should be used to draw the terminal cursor. If these are unset,
-  # the cursor color will be the inverse of the cell color.
-  #cursor:
-  #  text: '0x000000'
-  #  cursor: '0xffffff'
-
-  # Normal colors
-  normal:
-    black:   '0x000000'
-    red:     '0xd54e53'
-    green:   '0xb9ca4a'
-    yellow:  '0xe6c547'
-    blue:    '0x7aa6da'
-    magenta: '0xc397d8'
-    cyan:    '0x70c0ba'
-    white:   '0xeaeaea'
-
-  # Bright colors
-  bright:
-    black:   '0x666666'
-    red:     '0xff3334'
-    green:   '0x9ec400'
-    yellow:  '0xe7c547'
-    blue:    '0x7aa6da'
-    magenta: '0xb77ee0'
-    cyan:    '0x54ced6'
-    white:   '0xffffff'
-
+  # Colors (Solarized Dark)
+  primary:
+    background: '0x002b36' # base03
+    foreground: '0x839496' # base0
+
+  normal:
+    black:   '0x073642' # base02
+    red:     '0xdc322f' # red
+    green:   '0x859900' # green
+    yellow:  '0xb58900' # yellow
+    blue:    '0x268bd2' # blue
+    magenta: '0xd33682' # magenta
+    cyan:    '0x2aa198' # cyan
+    white:   '0xeee8d5' # base2
+
+  # Bright colors
+  bright:
+    black:   '0x002b36' # base03
+    red:     '0xcb4b16' # orange
+    green:   '0x586e75' # base01
+    yellow:  '0x657b83' # base00
+    blue:    '0x839496' # base0
+    magenta: '0x6c71c4' # violet
+    cyan:    '0x93a1a1' # base1
+    white:   '0xfdf6e3' # base3

透過させる

ちょっと透過させたほうがおしゃれということで、透過させます。
こちらも~/.config/alacritty/alacritty.ymlを更新

alacritty.yml
- background_opacity: 1.0
+ background_opacity: 0.95

おわりに

日本語表示のところでちょっとつまずいたけど、とても簡単に導入できました!
表示速度も良好です!


ほぼ一緒。。。と書こうとしたけど、けっこう色味がちがいますねw