← BACK TO KUBUNTU ENV
Terminal Setup

Ghostty & Zellij 構築

Kubuntu環境の高速なターミナルとして Ghostty を導入し、マルチプレクサの Zellij と組み合わせて使っている。見返すための備忘録。

パッケージのインストール

まずは必要なパッケージやツールをインストールする。

# Rustのインストール(ZellijやYaziなどRust製ツールのビルドに必要)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"

# ターミナルマルチプレクサ Zellij のインストール
cargo install zellij

# ファイルツリー (yazi) とその他の必須パッケージ
cargo install yazi-fm yazi-cli

※ Ghostty は現在ソースビルド環境のため、公式の手順(Zigやパッケージマネージャー経由)に従ってインストールする。

Ghostty 設定 (.config/ghostty/config)

# --- 見た目・フォント ---
font-size = 14
adjust-cell-height = 10%
# ツリー表示ツール(filetreeやyazi)のアイコンを表示するためNerd Fontを明示
font-family = "Hack Nerd Font"
theme = Moonfly

# --- ウィンドウ・透明度 ---
background-opacity = 0.90
background-blur-radius = 20
window-padding-x = 10
window-padding-y = 10
window-padding-balance = true

# --- 操作性 ---
mouse-hide-while-typing = true
copy-on-select = true
clipboard-read = allow
clipboard-write = allow

# --- キーバインド設定(Kubuntu向け画面分割スペシャル) ---
# Ctrl+Shift+D で「右に」分割(VSCodeや標準的なLinuxターミナルで馴染みのある配置)
keybind = ctrl+shift+d=new_split:right

# Ctrl+Shift+Enter で「下に」分割
keybind = ctrl+shift+enter=new_split:down

# Alt + 矢印キー で分割した画面を「移動」
keybind = alt+left=goto_split:left
keybind = alt+right=goto_split:right
keybind = alt+up=goto_split:top
keybind = alt+down=goto_split:bottom

# Ctrl + Shift + 矢印キー で分割サイズを「調整」
keybind = ctrl+shift+left=resize_split:left,20
keybind = ctrl+shift+right=resize_split:right,20
keybind = ctrl+shift+up=resize_split:up,20
keybind = ctrl+shift+down=resize_split:down,20

# Ctrl+Shift+W で現在の「ペイン(分割)」を閉じる
keybind = ctrl+shift+w=close_surface

VSCodeライクな画面分割キーバインドを取り入れつつ、適度な透明度やブラーを効かせて視認性とモダンな見た目を両立させている。

Zellij レイアウトと起動

# レイアウトディレクトリの作成
mkdir -p ~/.config/zellij/layouts

# カスタムレイアウトの設定
vim ~/.config/zellij/layouts/ide.kdl

ide.kdl の内容(2画面構成案)

左側にYazi(ファイルツリー)、右側にエディタ(Nvim/Helixなど)を配置する2画面構成(ツリー+エディタ)のZellijレイアウト案。

layout {
    default_tab_template {
        pane size=1 borderless=true {
            plugin location="zellij:tab-bar"
        }
        children
        pane size=2 borderless=true {
            plugin location="zellij:status-bar"
        }
    }
    tab name="VSCode Environment" split_direction="vertical" {
        // 左側のサイドバー領域(全体の20%の幅)
        // Gitツールを外し、Yazi(ファイルツリー)に縦幅を全振りする
        pane size="20%" command="yazi"

        // 右側のメイン作業領域(残りの80%)
        pane focus=true {
            // ここで nvim や hx (Helix) を立ち上げて編集する
        }
    }
}

起動コマンド

zellij --layout ide

作成した独自のIDEレイアウト(ide.kdl)を指定して起動し、即座に作業環境を立ち上げられるようにしている。