|
1 | | -{config, ...}: { |
| 1 | +{ |
| 2 | + config, |
| 3 | + pkgs, |
| 4 | + ... |
| 5 | +}: { |
2 | 6 | programs.kitty = { |
3 | 7 | enable = true; |
4 | 8 | font = { |
5 | 9 | name = "Iosevka"; |
6 | 10 | size = 12; |
7 | 11 | }; |
8 | 12 | 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"; |
11 | 14 |
|
12 | 15 | # make the font slightly wider |
13 | | - modify_font = "cell_width 105%"; |
| 16 | + # modify_font = "cell_width 105%"; |
14 | 17 |
|
15 | 18 | # this is how to use opentype features |
16 | 19 | font_features = "Iosevka cv99=6 cv85=8"; |
17 | 20 |
|
18 | 21 | # 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; |
22 | 25 | close_on_child_death = "yes"; |
23 | 26 | focus_follows_mouse = "no"; |
24 | 27 | enable_audio_bell = "no"; |
|
31 | 34 | scrollback_lines = "4000"; |
32 | 35 | scrollback_pager_history_size = "50"; |
33 | 36 | 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'"; |
35 | 57 |
|
36 | 58 | # selection |
37 | 59 | strip_trailing_spaces = "smart"; |
38 | 60 | copy_on_select = "yes"; |
39 | 61 |
|
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 | | - |
49 | 62 | # no default mappings |
50 | 63 | clear_all_shortcuts = "yes"; |
51 | 64 |
|
|
92 | 105 | mouse_map left click ungrabbed mouse_handle_click selection link prompt |
93 | 106 | ''; |
94 | 107 | 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 | | - |
98 | 108 | # os windows |
99 | 109 | "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"; |
101 | 112 |
|
102 | 113 | # clipboard |
103 | 114 | "ctrl+shift+c" = "copy_to_clipboard"; |
104 | 115 | "ctrl+shift+v" = "paste_from_clipboard"; |
105 | 116 |
|
106 | 117 | # 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"; |
117 | 123 |
|
118 | 124 | # font size |
119 | 125 | "ctrl+shift+equal" = "change_font_size current +2.0"; |
120 | 126 | "ctrl+shift+minus" = "change_font_size current -2.0"; |
121 | 127 | "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"; |
122 | 134 |
|
123 | 135 | # 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 -"; |
128 | 139 |
|
129 | 140 | # 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"; |
133 | 145 |
|
134 | 146 | # markers |
135 | 147 | "ctrl+shift+m" = "create_marker"; |
136 | 148 | "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"; |
209 | 150 | }; |
210 | 151 | }; |
211 | 152 | } |
0 commit comments