#
name

ok
dd
..
  • ,
..
.
..
© Copyright 2023 joppot. All rights reserved.

ghosttyをセットアップしてみた

#
zsh
2025年1月14日
thumbnail
新しいターミナルクライアントが出るたびに触ってみるのですが、CUI版のEmacsが使えない問題があり、大体諦めてiTerm2をつか続けています。iTerm2が悪いわけではないのですが、流行りのwarpとかghosttyとか使ってみたいものです。
試しにghostty使ってセットアップを進めていく中で、もしかするとCUI版Emacsを使えるのではと思えてきたので、ここにghosttyのインストールとセットアップをまとめておきます。

インストール

以下のコマンドでインストールします。
brew info ghostty
brew install ghostty

セットアップ

ghosttyの設定は、以下の場所にファイルを作成し、その中に記述します。
mkdir -p .config/ghostty
touch .config/ghostty/config

テーマの反映

ghosttyは有名なカラーテーマを標準で要しています。 下のコマンドで好きなテーマを探します。
ghostty +list-themes
article image
私はiceberg-darkを利用します。 .config/ghostty/configファイルを開いて、下の設定を追加します。 選択したテーマに伴って、いくつか色合いを調整します。
# System
# テキスト選択時に自動的にクリップボードにコピー
copy-on-select = clipboard

# Theme
# icebergテーマを利用
theme = Iceberg Dark
# 分割された画面の非アクティブなウィンドウの透過度を0.92に設定
unfocused-split-opacity=0.92
# カーソルの色を指定(16進数カラーコード)
cursor-color = d1d2d2
# カーソルの点滅を無効にする
cursor-style-blink = false
# テキスト選択範囲の背景色を指定
selection-background = c0deff
# 背景色の透明度を0.9に設定
background-opacity = 0.9
# ウィンドウサイズ変更時のツールチップを非表示にする
resize-overlay = never

# Font
# メインフォント: MesloLGS Nerd Font(記号・アイコン対応)
# font-family= JetBrains Mono
#font-family= Monaco
#font-family = Roboto Mono for Powerline
font-family= MesloLGS Nerd Font Propo
#font-family= BIZ UDMincho
# フォールバック: Noto Sans JP(日本語対応)
font-family= Noto Sans JP
#font-family= Osaka

# フォントの太さを520に設定(通常よりやや太め)
font-variation = wght=520
# 合字(contextual alternates)を無効
font-feature = -calt
# 装飾用合字(discretionary ligatures)を無効
font-feature = -dlig

# Keybind
# Super+Page Upのデフォルト動作を無効化
keybind = super+page_up=unbind
# Emacsキーバインディング(Alt+キーで ESC + キーを送信、Metaキー相当)
keybind = alt+f=esc:f
keybind = alt+x=esc:x
keybind = alt+k=esc:k
keybind = alt+h=esc:h
keybind = alt+q=esc:q
keybind = alt+l=esc:l
keybind = alt+:=esc::
# Ctrl+Alt+F: ESC キーを送信(^F として使用可能)
keybind = ctrl+alt+f=text:\x1b\x06
# Alt+Shift+,: < 記号を ESC 付きで送信
keybind = alt+shift+,=text:\x1b\x3c
# Alt+Shift+.: > 記号を ESC 付きで送信
keybind = alt+shift+.=text:\x1b\x3e
# Shift+Enter: 改行を送信(送信しない改行挿入)
keybind = shift+enter=text:\x0a

# Tab Navigation
# 日本語キーボード対応:物理キーの競合を解消
keybind = super+shift+bracket_right=unbind
keybind = super+shift+bracket_left=unbind
# Command+Shift+{: 左のタブに移動
keybind = super+shift+[=previous_tab
# Command+Shift+}: 右のタブに移動
keybind = super+shift+]=next_tab
保存したらCmd+Shift+,でghosttyの設定を再読み込みします。
article image

まとめ

一旦、この設定で使ってみます。 もしも、設定を追加したら、加えていこうと思います。
© Copyright 2023 joppot. All rights reserved.