Skip to content

Commit 1b398a7

Browse files
committed
term: switch back to kitty
1 parent 8302d5f commit 1b398a7

File tree

3 files changed

+54
-113
lines changed

3 files changed

+54
-113
lines changed

home/wayland/ghostty.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@
6161
# usability
6262
keybind = ctrl+shift+n=new_window
6363
keybind = ctrl+shift+j=write_scrollback_file:paste
64+
keybind = ctrl+shift+k=write_screen_file:paste
6465
6566
keybind = ctrl+page_up=jump_to_prompt:-1
6667
keybind = ctrl+page_down=jump_to_prompt:1
6768
keybind = shift+page_down=scroll_page_down
6869
keybind = shift+page_up=scroll_page_up
6970
keybind = shift+end=scroll_to_bottom
7071
71-
7272
# goodies
7373
keybind = ctrl+shift+i=inspector:toggle
7474
keybind = ctrl+shift+comma=reload_config

home/wayland/kitty.nix

Lines changed: 51 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
1-
{config, ...}: {
1+
{
2+
config,
3+
pkgs,
4+
...
5+
}: {
26
programs.kitty = {
37
enable = true;
48
font = {
59
name = "Iosevka";
610
size = 12;
711
};
812
settings = {
9-
# generated from https://github.com/ryanoasis/nerd-fonts/wiki/Glyph-Sets-and-Code-Points
10-
symbol_map = "U+23fb-U+23fe,U+2665,U+26a1,U+2b58,U+e000-U+e00a,U+e0a0-U+e0a2,U+e0a3,U+e0b0-U+e0b3,U+e0b4-U+e0c8,U+e0ca,U+e0cc-U+e0d7,U+e200-U+e2a9,U+e300-U+e3e3,U+e5fa-U+e6b5,U+e700-U+e7c5,U+ea60-U+ec1e,U+ed00-U+efc1,U+f000-U+f2ff,U+f300-U+f372,U+f400-U+f533,U+f500-U+fd46,U+f0001-U+f1af0,U+276c-U+2771,U+2500-U+259f,U+274C Symbols Nerd Font Mono"; # the last entry is ❌, which we wanna have it it's flat, no-color variant
13+
symbol_map = "U+23fb-U+23fe,U+2665,U+26a1,U+2b58,U+e000-U+e00a,U+e0a0-U+e0a2,U+e0a3,U+e0b0-U+e0b3,U+e0b4-U+e0c8,U+e0ca,U+e0cc-U+e0d7,U+e200-U+e2a9,U+e300-U+e3e3,U+e5fa-U+e6b5,U+e700-U+e7c5,U+ea60-U+ec1e,U+ed00-U+efc1,U+f000-U+f2ff,U+f300-U+f372,U+f400-U+f533,U+f500-U+fd46,U+f0001-U+f1af0,U+276c-U+2771,U+2500-U+259f,U+274C Symbols Nerd Font Mono";
1114

1215
# make the font slightly wider
13-
modify_font = "cell_width 105%";
16+
# modify_font = "cell_width 105%";
1417

1518
# this is how to use opentype features
1619
font_features = "Iosevka cv99=6 cv85=8";
1720

1821
# basics
19-
# cursor_trail = 100;
20-
# cursor_trail_decay = "0.3 0.3";
21-
# cursor_trail_start_threshold = 16;
22+
cursor_trail = 100;
23+
cursor_trail_decay = "0.3 0.3";
24+
cursor_trail_start_threshold = 16;
2225
close_on_child_death = "yes";
2326
focus_follows_mouse = "no";
2427
enable_audio_bell = "no";
@@ -31,21 +34,31 @@
3134
scrollback_lines = "4000";
3235
scrollback_pager_history_size = "50";
3336
scrollback_fill_enlarged_window = "yes";
34-
scrollback_pager = "bash -c \"exec nvim 63<&0 0</dev/null -c 'autocmd TermEnter * stopinsert' -c 'autocmd TermClose * call cursor(max([0,INPUT_LINE_NUMBER-1])+CURSOR_LINE, CURSOR_COLUMN)' -c 'terminal sed </dev/fd/63 -e \\\"s/'$'\\x1b'']8 file:[^\\]*[\\]//g\\\" && sleep 0.01 && printf \\\"'$'\\x1b'']2;\\\"' -c 'set modifiable'\"";
37+
scrollback_pager = "${pkgs.writeScript "pager.sh" ''
38+
#!/usr/bin/env bash
39+
set -eu
40+
41+
if [ "$#" -eq 3 ]; then
42+
INPUT_LINE_NUMBER=''\${1:-0}
43+
CURSOR_LINE=''\${2:-1}
44+
CURSOR_COLUMN=''\${3:-1}
45+
AUTOCMD_TERMCLOSE_CMD="call cursor(max([0,''\${INPUT_LINE_NUMBER}-1])+''\${CURSOR_LINE}, ''\${CURSOR_COLUMN})"
46+
else
47+
AUTOCMD_TERMCLOSE_CMD="normal G"
48+
fi
49+
50+
exec nvim 63<&0 0</dev/null \
51+
-c "map <silent> q :qa!<CR>" \
52+
-c "set shell=bash scrollback=100000 termguicolors laststatus=0 clipboard+=unnamedplus" \
53+
-c "autocmd TermEnter * stopinsert" \
54+
-c "autocmd TermClose * ''\${AUTOCMD_TERMCLOSE_CMD}" \
55+
-c 'terminal sed </dev/fd/63 -e "s/'$'\x1b''\'''\']8;;file:[^\]*[\]//g" && sleep 0.01 && printf "'$'\x1b''\'''\']2;"'
56+
''} 'INPUT_LINE_NUMBER' 'CURSOR_LINE' 'CURSOR_COLUMN'";
3557

3658
# selection
3759
strip_trailing_spaces = "smart";
3860
copy_on_select = "yes";
3961

40-
# layouts
41-
enabled_layouts = "tall,fat,vertical,horizontal,grid,splits,stack";
42-
43-
# tab style
44-
tab_bar_style = "powerline";
45-
tab_powerline_style = "slanted";
46-
tab_title_template = "{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{'*' if layout_name == 'stack' and num_windows > 1 else ''}{index}: {tab.active_exe}";
47-
active_tab_font_style = "bold";
48-
4962
# no default mappings
5063
clear_all_shortcuts = "yes";
5164

@@ -92,120 +105,48 @@
92105
mouse_map left click ungrabbed mouse_handle_click selection link prompt
93106
'';
94107
keybindings = {
95-
"alt+f1" = "toggle_marker iregex 1 \\\\berr(or)?\\\\b 2 \\\\bwarn(ing)?\\\\b 3 \\\\b(info|debug|trace)\\\\b";
96-
"alt+f2" = "toggle_marker regex 1 \\\\bOOMKilled\\\\b 2 \\\\bTerminated\\\\b 3 \\\\bRunning\\\\b";
97-
98108
# os windows
99109
"ctrl+shift+n" = "launch --type=os-window --cwd=current";
100-
"ctrl+shift+r" = "set_window_title";
110+
"alt+n" = "launch --type=os-window --cwd=current";
111+
"alt+r" = "set_window_title";
101112

102113
# clipboard
103114
"ctrl+shift+c" = "copy_to_clipboard";
104115
"ctrl+shift+v" = "paste_from_clipboard";
105116

106117
# scrolling
107-
"ctrl+page_up" = "scroll_page_up";
108-
"ctrl+page_down" = "scroll_page_down";
109-
"ctrl+shift+page_up" = "scroll_home";
110-
"ctrl+shift+page_down" = "scroll_end";
111-
"ctrl+shift+[" = "scroll_to_prompt -1";
112-
"ctrl+shift+]" = "scroll_to_prompt +1";
113-
114-
# dump output to vim
115-
"ctrl+shift+h" = "show_scrollback";
116-
"ctrl+shift+g" = "show_last_command_output";
118+
"shift+page_up" = "scroll_page_up";
119+
"shift+page_down" = "scroll_page_down";
120+
"shift+end" = "scroll_end";
121+
"alt+page_up" = "scroll_to_prompt -1";
122+
"alt+page_down" = "scroll_to_prompt +1";
117123

118124
# font size
119125
"ctrl+shift+equal" = "change_font_size current +2.0";
120126
"ctrl+shift+minus" = "change_font_size current -2.0";
121127
"ctrl+shift+0" = "change_font_size current 0";
128+
"alt+equal" = "change_font_size current +2.0";
129+
"alt+minus" = "change_font_size current -2.0";
130+
"alt+0" = "change_font_size current 0";
131+
132+
# dump output to vim
133+
"alt+h" = "show_scrollback";
122134

123135
# paste things
124-
"ctrl+shift+p>h" = "kitten hints --type hash --program -";
125-
"ctrl+shift+p>w" = "kitten hints --type word --program -";
126-
"ctrl+shift+p>l" = "kitten hints --type line --program -";
127-
"ctrl+shift+p>p" = "kitten hints --type path --program -";
136+
"alt+g" = "kitten hints --hints-text-color=red --type hash --program -";
137+
"alt+w" = "kitten hints --hints-text-color=red --type word --program -";
138+
"alt+l" = "kitten hints --hints-text-color=red --type line --program -";
128139

129140
# quick actions
130-
"ctrl+shift+u" = "kitten unicode_input";
131-
"ctrl+shift+e" = "open_url_with_hints";
132-
"ctrl+shift+o" = "kitten hints --type linenum";
141+
"alt+f" = "kitten hints --hints-text-color=red --type path";
142+
"ctrl+shift+e" = "kitten hints --hints-text-color=red --type url --program default";
143+
"alt+u" = "kitten hints --hints-text-color=red --type url --program default";
144+
"alt+shift+u" = "kitten unicode_input";
133145

134146
# markers
135147
"ctrl+shift+m" = "create_marker";
136148
"ctrl+shift+," = "remove_marker";
137-
138-
# not used in tiling wm:
139-
# tabs
140-
"ctrl+shift+enter" = "new_tab_with_cwd";
141-
"ctrl+shift+t" = "new_tab";
142-
"ctrl+shift+j" = "previous_tab";
143-
"ctrl+shift+k" = "next_tab";
144-
"ctrl+shift+right" = "move_tab_forward";
145-
"ctrl+shift+left" = "move_tab_backward";
146-
147-
# pane creation and navigation
148-
"alt+enter" = "launch --location=vsplit --cwd=current";
149-
"shift+alt+enter" = "launch --location=vsplit";
150-
"shift+alt+v" = "launch --location=hsplit";
151-
"alt+h" = "neighboring_window left";
152-
"alt+j" = "neighboring_window down";
153-
"alt+k" = "neighboring_window up";
154-
"alt+l" = "neighboring_window right";
155-
"alt+tab" = "focus_visible_window";
156-
"alt+m" = "swap_with_window";
157-
"alt+d" = "detach_window new-tab";
158-
159-
# pane resizing
160-
"alt+r" = "resize_window reset";
161-
"shift+alt+r" = "start_resizing_window";
162-
"alt+up" = "resize_window taller";
163-
"alt+down" = "resize_window shorter";
164-
"alt+right" = "resize_window wider";
165-
"alt+left" = "resize_window narrower";
166-
"shift+alt+up" = "resize_window taller 8";
167-
"shift+alt+down" = "resize_window shorter 8";
168-
"shift+alt+right" = "resize_window wider 5";
169-
"shift+alt+left" = "resize_window narrower 5";
170-
171-
# select layouts
172-
"alt+backspace" = "next_layout";
173-
"alt+space" = "toggle_layout stack";
174-
"alt+t" = "goto_layout tall";
175-
"shift+alt+t" = "goto_layout tall:bias=70;mirrored=true";
176-
"alt+f" = "goto_layout fat";
177-
"shift+alt+f" = "goto_layout fat:bias=70";
178-
"alt+s" = "goto_layout splits";
179-
"alt+g" = "goto_layout grid";
180-
181-
# layout actions
182-
"alt+[" = "layout_action decrease_num_full_size_windows";
183-
"alt+]" = "layout_action increase_num_full_size_windows";
184-
"alt+backslash" = "layout_action mirror toggle";
185-
"alt+b" = "layout_action bias 30 40 50 60 70 80";
186-
187-
# directly jump to windows and tabs
188-
"alt+`" = "nth_window -1";
189-
"alt+1" = "nth_window 0";
190-
"alt+2" = "nth_window 1";
191-
"alt+3" = "nth_window 2";
192-
"alt+4" = "nth_window 3";
193-
"alt+5" = "nth_window 4";
194-
"alt+6" = "nth_window 5";
195-
"alt+7" = "nth_window 6";
196-
"alt+8" = "nth_window 7";
197-
"alt+9" = "nth_window 8";
198-
"alt+0" = "nth_window 9";
199-
"ctrl+shift+`" = "goto_tab -1";
200-
"ctrl+shift+1" = "goto_tab 1";
201-
"ctrl+shift+2" = "goto_tab 2";
202-
"ctrl+shift+3" = "goto_tab 3";
203-
"ctrl+shift+4" = "goto_tab 4";
204-
"ctrl+shift+5" = "goto_tab 5";
205-
"ctrl+shift+6" = "goto_tab 6";
206-
"ctrl+shift+7" = "goto_tab 7";
207-
"ctrl+shift+8" = "goto_tab 8";
208-
"ctrl+shift+9" = "goto_tab 9";
149+
"alt+f1" = "toggle_marker iregex 1 \\\\berr(or)?\\\\b 2 \\\\bwarn(ing)?\\\\b 3 \\\\b(info|debug|trace)\\\\b";
209150
};
210151
};
211152
}

home/wayland/sway.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
'';
3434
config = {
3535
modifier = "Mod4";
36-
terminal = "ghostty";
36+
terminal = "kitty";
3737
workspaceAutoBackAndForth = true;
3838
fonts = {
3939
names = ["Fira Mono"];
@@ -202,7 +202,7 @@
202202
"Mod4+Shift+Backspace" = "output eDP-1 disable";
203203

204204
# run
205-
"Mod4+Return" = "exec ghostty";
205+
"Mod4+Return" = "exec kitty";
206206
"XF86Display" = "exec ${pkgs.wdisplays}/bin/wdisplays";
207207

208208
# lock

0 commit comments

Comments
 (0)