lxz

lxz

C++ | Typescript | 图形白痴

macOS用のKitty設定

私は数日間 Kitty を使用しています。nvim 用のプラグインがあり、Kitty とシームレスにフォーカスを切り替えられるので、設定を繰り返す必要がなく、とても気に入っています。

使用期間を経て、設定の一部を完了しましたので、共有したいと思います。

関連する機能のために異なるフォルダを使用しています。テーマ、タブ、ウィンドウ、ショートカットなどです。

# lxz @ lxzMacBook-Pro in ~/.dot/kitty/.config/kitty on git:master o [16:38:58]
$ tree
.
├── kitty.conf
├── kitty.d
│   ├── init
│   │   └── init.conf
│   ├── keybind
│   │   ├── init.conf
│   │   ├── nvim.conf
│   │   ├── tab.conf
│   │   └── window.conf
│   ├── session
│   │   └── init.conf
│   └── theme
│       ├── background.conf
│       ├── color.conf
│       ├── font.conf
│       ├── tabbar.conf
│       └── window.conf
└── session.conf

6 directories, 13 files

基本設定#

kitty.conf では、他のディレクトリにある設定ファイルを読み込むように設定しています。

globinclude kitty.d/**/*.conf

分割後の設定は表示しませんが、機能に応じてヒントを示します。

初期設定#

init.conf では、いくつかのデフォルト変数を設定しています。

term xterm-256color
shell_integration enabled
allow_hyperlinks yes
editor nvim

テーマ設定#

タブ設定#

タブ設定では、powerlineスタイルが好きです。

tab_bar_style powerline

ウィンドウ設定#

window_border_width 0.5pt

window_resize_step_cells 2
window_resize_step_lines 2

initial_window_width  640
initial_window_height 400

draw_minimal_borders yes

inactive_text_alpha 0.7

hide_window_decorations no

macos_titlebar_color background
macos_thicken_font 0.75

active_border_color none

# デフォルトのレイアウトは縦分割のみ
enabled_layouts splits

enable_audio_bell no

フォント設定#

font_family FiraCode Nerd Font Mono Retina
font_size 16.0

カラー設定#

# Dark One Nuanced by ariasuni, https://store.kde.org/p/1225908
# Imported from KDE .colorscheme format by thematdev, https://thematdev.org
# For migrating your schemes from Konsole format see
# https://git.thematdev.org/thematdev/konsole-scheme-migration


# importing Background
background #282c34
# importing BackgroundFaint
# importing BackgroundIntense
# importing Color0
color0 #3f4451
# importing Color0Faint
color16 #282c34
# importing Color0Intense
color8 #4f5666
# importing Color1
color1 #e06c75
# importing Color1Faint
color17 #c25d66
# importing Color1Intense
color9 #ff7b86
# importing Color2
color2 #98c379
# importing Color2Faint
color18 #82a566
# importing Color2Intense
color10 #b1e18b
# importing Color3
color3 #d19a66
# importing Color3Faint
color19 #b38257
# importing Color3Intense
color11 #efb074
# importing Color4
color4 #61afef
# importing Color4Faint
color20 #5499d1
# importing Color4Intense
color12 #67cdff
# importing Color5
color5 #c678dd
# importing Color5Faint
color21 #a966bd
# importing Color5Intense
color13 #e48bff
# importing Color6
color6 #56b6c2
# importing Color6Faint
color22 #44919a
# importing Color6Intense
color14 #63d4e0
# importing Color7
color7 #e6e6e6
# importing Color7Faint
color23 #c8c8c8
# importing Color7Intense
color15 #ffffff
# importing Foreground
foreground #abb2bf
# importing ForegroundFaint
# importing ForegroundIntense
# importing General

ショートカット設定#

初期設定#

# ターミナル画面をクリア
map cmd+k combine : clear_terminal scrollback active : send_text normal,application \x0c

# 単語の先頭と末尾にジャンプ
map alt+left send_text all \x1b\x62
map alt+right send_text all \x1b\x66

# 行の先頭と末尾にジャンプ
map cmd+left send_text all \x01
map cmd+right send_text all \x05

# cmd + <num>を対応するタブにマッピング
map cmd+1 goto_tab 1
map cmd+2 goto_tab 2
map cmd+3 goto_tab 3
map cmd+4 goto_tab 4
map cmd+5 goto_tab 5
map cmd+6 goto_tab 6
map cmd+7 goto_tab 7
map cmd+8 goto_tab 8
map cmd+9 goto_tab 9

# フォントサイズの変更
map cmd+equal    change_font_size all +2.0
map cmd+minus    change_font_size all -2.0
map cmd+0        change_font_size all 0

map cmd+c        copy_to_clipboard
map cmd+v        paste_from_clipboard

タブ#

map alt+1 goto_tab 1
map alt+2 goto_tab 2
map alt+3 goto_tab 3
map alt+4 goto_tab 4
map alt+5 goto_tab 5
map alt+6 goto_tab 6
map alt+7 goto_tab 7
map alt+8 goto_tab 8
map alt+9 goto_tab 9
map alt+0 goto_tab 0

# cmd+tで新しいタブを開く
map cmd+t new_tab

# 次と前のスプリット間を切り替える
map cmd+]        next_window
map cmd+[        previous_window

ウィンドウ#

# cmd+dで新しいスプリット(ウィンドウ)を開き、cwdを保持
map cmd+w close_window
map cmd+shif+n new_os_window
map cmd+d launch --location=hsplit --cwd=current
map cmd+shift+d launch --location=vsplit --cwd=current

セッション#

Kitty はセッション管理をサポートしており、いくつかのデフォルトセッションを追加し、nvim 用のセッションソケットを開きました。

ルートの session.conf はセッションの場所設定です。

new_tab home
layout splits
cd ~
launch zsh
focus

new_tab work
cd ~/Develop/linuxdeepin/
launch zsh

new_tab nvim
cd ~/.config/nvim
launch zsh

初期設定#

startup_session session.conf

# 他のUnixシステム:
allow_remote_control yes
listen_on unix:/tmp/.kitty
読み込み中...
文章は、創作者によって署名され、ブロックチェーンに安全に保存されています。