用途:配置 Zellij 终端复用器,覆盖初始化、布局、主题、键位与行为设置。
主要能力:
- 配置文件路径遵循 XDG 规范:主配置 ~/.config/zellij/config.kdl,主题位于 ~/.config/zellij/themes/,布局位于 ~/.config/zellij/layouts/。
- 初始化:mkdir -p ~/.config/zellij 后执行 zellij setup --dump-config > ~/.config/zellij/config.kdl 生成默认配置;用 zellij setup --check 检查路径。
- 常规设置:如 mouse_mode、pane_frames、copy_on_select、scroll_buffer_size、default_shell、default_layout、theme、simplified_ui、session_serialization,以及 copy_command(macOS 用 pbcopy,Linux X11 用 xclip -selection clipboard,Wayland 用 wl-copy)。
- 布局:在 layouts/*.kdl 中定义 pane、split_direction、size、command、args、cwd、focus、borderless,并可用 default_tab_template 统一 tab 结构,引用 zellij:tab-bar、zellij:status-bar 插件。
- 主题:在 themes/*.kdl 定义 fg、bg 与 ANSI 色及 UI 组件配色;可引用内置主题如 catppuccin-mocha、dracula、gruvbox-dark、nord、tokyo-night。启用方式为 config.kdl 中 theme "名称" 或 zellij options --theme 名称。
- 键位:在 keybinds 中按模式(normal、pane、tab、resize、move、scroll、locked 等)绑定动作,如 SwitchToMode、MoveFocus、NewPane、CloseFocus、GoToTab、ToggleFocusFullscreen;支持 Ctrl/Alt/F 键等写法。
使用方式:新建配置用 zellij setup --dump-config 生成,增量修改用编辑,新增布局/主题用写入;KDL 需正确嵌套、字符串加引号、无尾逗号、注释用 //。多数配置支持热重载,并对新窗格/标签/会话生效。
限制:资料未提供具体版本要求、各设置取值范围或冲突说明;不涉及 Zellij 安装方式;内置主题列表仅为资料所列举。
参考文档:Configuration、Keybindings、Themes、Layouts 页面(zellij.dev 文档)。