]> git.rmz.io Git - dotfiles.git/blob - kitty/kitty.conf
kitty: use dvorak home row for hints
[dotfiles.git] / kitty / kitty.conf
1 # vim:fileencoding=utf-8:ft=conf:foldmethod=marker
2
3 #: Fonts {{{
4
5 #: To list all fonts: `kitty list-fonts`
6 font_family Fira Code
7 font_size 11.0
8
9 #: Fira has a few features see https://github.com/tonsky/FiraCode/wiki/How-to-enable-stylistic-sets
10 font_features FiraCode-Bold +ss03
11 font_features FiraCode-Light +ss03
12 font_features FiraCode-Medium +ss03
13 font_features FiraCode-Regular +ss03
14 font_features FiraCode-Retina +ss03
15 font_features FiraCode-SemiBold +ss03
16
17 # symbol_map U+E0A0-U+E0A3,U+E0C0-U+E0C7 PowerlineSymbols
18
19 #: }}}
20
21 #: Cursor customization {{{
22
23 #: One of block, beam or underline (thickness can also be configured)
24 cursor_shape block
25 cursor_blink_interval 0
26
27 #: }}}
28
29 #: Scrollback {{{
30
31 scrollback_lines 2000
32
33 #: Separate scrollback pager (MB)
34 #:TODO what is this exactly?
35 scrollback_pager_history_size 100
36 scrollback_pager less --chop-long-lines --RAW-CONTROL-CHARS +INPUT_LINE_NUMBER
37
38 #: }}}
39
40 #: Mouse {{{
41
42 #: URLs
43 detect_urls yes
44 url_prefixes http https file ftp
45 open_url_with default
46 open_url_modifiers kitty_mod
47 url_style curly
48
49 #: coping and selection
50 copy_on_select no
51 strip_trailing_spaces never
52 rectangle_select_modifiers ctrl+alt
53 terminal_select_modifiers shift
54 select_by_word_characters @-./_~?&=%+#
55 click_interval 0.5
56
57 focus_follows_mouse yes
58
59 default_pointer_shape beam
60 pointer_shape_when_grabbed arrow
61 pointer_shape_when_dragging beam
62
63 #: }}}
64
65 #: Performance tuning {{{
66
67 repaint_delay 10
68
69 #: Delay (in milliseconds) between screen updates. Decreasing it,
70 #: increases frames-per-second (FPS) at the cost of more CPU usage.
71 #: The default value yields ~100 FPS which is more than sufficient for
72 #: most uses. Note that to actually achieve 100 FPS you have to either
73 #: set sync_to_monitor to no or use a monitor with a high refresh
74 #: rate. Also, to minimize latency when there is pending input to be
75 #: processed, repaint_delay is ignored.
76
77 input_delay 3
78
79 #: Delay (in milliseconds) before input from the program running in
80 #: the terminal is processed. Note that decreasing it will increase
81 #: responsiveness, but also increase CPU usage and might cause flicker
82 #: in full screen programs that redraw the entire screen on each loop,
83 #: because kitty is so fast that partial screen updates will be drawn.
84
85 sync_to_monitor yes
86
87 #: Sync screen updates to the refresh rate of the monitor. This
88 #: prevents tearing (https://en.wikipedia.org/wiki/Screen_tearing)
89 #: when scrolling. However, it limits the rendering speed to the
90 #: refresh rate of your monitor. With a very high speed mouse/high
91 #: keyboard repeat rate, you may notice some slight input latency. If
92 #: so, set this to no.
93
94 #: }}}
95
96 #: Terminal bell {{{
97
98 enable_audio_bell no
99 window_alert_on_bell yes
100 bell_on_tab yes
101 command_on_bell none
102
103 #: }}}
104
105 #: Window layout {{{
106
107 remember_window_size no
108 initial_window_width 80c
109 initial_window_height 24c
110
111 #: See https://sw.kovidgoyal.net/kitty/index.html#layouts.
112 enabled_layouts *
113
114 resize_draw_strategy static
115 resize_debounce_time 0.00
116 placement_strategy top-left
117 resize_in_steps no
118
119 confirm_os_window_close 2
120
121 #: }}}
122
123 #: Tab bar {{{
124
125 tab_bar_style powerline
126 tab_bar_edge bottom
127 tab_bar_min_tabs 2
128 tab_bar_margin_width 0.0
129 tab_switch_strategy previous
130
131 tab_activity_symbol none
132
133 #: Template supporting {index}, {title}, {num_windows}, some formatting options
134 #: are also available.
135 #: See https://sw.kovidgoyal.net/kitty/conf.html#opt-kitty.tab_title_template
136 tab_title_template "{title}"
137 active_tab_title_template none
138
139 #: }}}
140
141 #: Color scheme {{{
142
143 include colors/nord.conf
144
145 #: }}}
146
147 #: Advanced {{{
148
149 shell .
150
151 #: The shell program to execute. The default value of . means to use
152 #: whatever shell is set as the default shell for the current user.
153 #: Note that on macOS if you change this, you might need to add
154 #: --login to ensure that the shell starts in interactive mode and
155 #: reads its startup rc files.
156
157 editor .
158
159 #: The console editor to use when editing the kitty config file or
160 #: similar tasks. A value of . means to use the environment variables
161 #: VISUAL and EDITOR in that order. Note that this environment
162 #: variable has to be set not just in your shell startup scripts but
163 #: system-wide, otherwise kitty will not see it.
164
165 close_on_child_death no
166
167 #: Close the window when the child process (shell) exits. If no (the
168 #: default), the terminal will remain open when the child exits as
169 #: long as there are still processes outputting to the terminal (for
170 #: example disowned or backgrounded processes). If yes, the window
171 #: will close as soon as the child process exits. Note that setting it
172 #: to yes means that any background processes still using the terminal
173 #: can fail silently because their stdout/stderr/stdin no longer work.
174
175 allow_remote_control yes
176
177 #: Allow other programs to control kitty. If you turn this on other
178 #: programs can control all aspects of kitty, including sending text
179 #: to kitty windows, opening new windows, closing windows, reading the
180 #: content of windows, etc. Note that this even works over ssh
181 #: connections. You can chose to either allow any program running
182 #: within kitty to control it, with yes or only programs that connect
183 #: to the socket specified with the kitty --listen-on command line
184 #: option, if you use the value socket-only. The latter is useful if
185 #: you want to prevent programs running on a remote computer over ssh
186 #: from controlling kitty.
187
188 listen_on none
189
190 #: Tell kitty to listen to the specified unix/tcp socket for remote
191 #: control connections. Note that this will apply to all kitty
192 #: instances. It can be overridden by the kitty --listen-on command
193 #: line flag. This option accepts only UNIX sockets, such as
194 #: unix:${TEMP}/mykitty or (on Linux) unix:@mykitty. Environment
195 #: variables are expanded. If {kitty_pid} is present then it is
196 #: replaced by the PID of the kitty process, otherwise the PID of the
197 #: kitty process is appended to the value, with a hyphen. This option
198 #: is ignored unless you also set allow_remote_control to enable
199 #: remote control. See the help for kitty --listen-on for more
200 #: details.
201
202 # env
203
204 #: Specify environment variables to set in all child processes. Note
205 #: that environment variables are expanded recursively, so if you
206 #: use::
207
208 #: env MYVAR1=a
209 #: env MYVAR2=${MYVAR1}/${HOME}/b
210
211 #: The value of MYVAR2 will be a/<path to home directory>/b.
212
213 update_check_interval 24
214
215 #: Periodically check if an update to kitty is available. If an update
216 #: is found a system notification is displayed informing you of the
217 #: available update. The default is to check every 24 hrs, set to zero
218 #: to disable.
219
220 startup_session none
221
222 #: Path to a session file to use for all kitty instances. Can be
223 #: overridden by using the kitty --session command line option for
224 #: individual instances. See
225 #: https://sw.kovidgoyal.net/kitty/index.html#sessions in the kitty
226 #: documentation for details. Note that relative paths are interpreted
227 #: with respect to the kitty config directory. Environment variables
228 #: in the path are expanded.
229
230 clipboard_control write-clipboard write-primary
231
232 #: Allow programs running in kitty to read and write from the
233 #: clipboard. You can control exactly which actions are allowed. The
234 #: set of possible actions is: write-clipboard read-clipboard write-
235 #: primary read-primary. You can additionally specify no-append to
236 #: disable kitty's protocol extension for clipboard concatenation. The
237 #: default is to allow writing to the clipboard and primary selection
238 #: with concatenation enabled. Note that enabling the read
239 #: functionality is a security risk as it means that any program, even
240 #: one running on a remote server via SSH can read your clipboard.
241
242 allow_hyperlinks yes
243
244 #: Process hyperlink (OSC 8) escape sequences. If disabled OSC 8
245 #: escape sequences are ignored. Otherwise they become clickable
246 #: links, that you can click by holding down ctrl+shift and clicking
247 #: with the mouse. The special value of ``ask`` means that kitty will
248 #: ask before opening the link.
249
250 term xterm-kitty
251
252 #: The value of the TERM environment variable to set. Changing this
253 #: can break many terminal programs, only change it if you know what
254 #: you are doing, not because you read some advice on Stack Overflow
255 #: to change it. The TERM variable is used by various programs to get
256 #: information about the capabilities and behavior of the terminal. If
257 #: you change it, depending on what programs you run, and how
258 #: different the terminal you are changing it to is, various things
259 #: from key-presses, to colors, to various advanced features may not
260 #: work.
261
262 #: }}}
263
264 #: Keyboard shortcuts {{{
265
266 #: Keys are identified simply by their lowercase unicode characters.
267 #: For example: ``a`` for the A key, ``[`` for the left square bracket
268 #: key, etc. For functional keys, such as ``Enter or Escape`` the
269 #: names are present at https://sw.kovidgoyal.net/kitty/keyboard-
270 #: protocol.html#functional-key-definitions. For a list of modifier
271 #: names, see: GLFW mods
272 #: <https://www.glfw.org/docs/latest/group__mods.html>
273
274 #: On Linux you can also use XKB key names to bind keys that are not
275 #: supported by GLFW. See XKB keys
276 #: <https://github.com/xkbcommon/libxkbcommon/blob/master/xkbcommon/xkbcommon-
277 #: keysyms.h> for a list of key names. The name to use is the part
278 #: after the XKB_KEY_ prefix. Note that you can only use an XKB key
279 #: name for keys that are not known as GLFW keys.
280
281 #: Finally, you can use raw system key codes to map keys, again only
282 #: for keys that are not known as GLFW keys. To see the system key
283 #: code for a key, start kitty with the kitty --debug-keyboard option.
284 #: Then kitty will output some debug text for every key event. In that
285 #: text look for ``native_code`` the value of that becomes the key
286 #: name in the shortcut. For example:
287
288 #: .. code-block:: none
289
290 #: on_key_input: glfw key: 65 native_code: 0x61 action: PRESS mods: 0x0 text: 'a'
291
292 #: Here, the key name for the A key is 0x61 and you can use it with::
293
294 #: map ctrl+0x61 something
295
296 #: to map ctrl+a to something.
297
298 #: You can use the special action no_op to unmap a keyboard shortcut
299 #: that is assigned in the default configuration::
300
301 #: map kitty_mod+space no_op
302
303 #: You can combine multiple actions to be triggered by a single
304 #: shortcut, using the syntax below::
305
306 #: map key combine <separator> action1 <separator> action2 <separator> action3 ...
307
308 #: For example::
309
310 #: map kitty_mod+e combine : new_window : next_layout
311
312 #: this will create a new window and switch to the next available
313 #: layout
314
315 #: You can use multi-key shortcuts using the syntax shown below::
316
317 #: map key1>key2>key3 action
318
319 #: For example::
320
321 #: map ctrl+f>2 set_font_size 20
322
323 kitty_mod ctrl+shift
324
325 #: The value of kitty_mod is used as the modifier for all default
326 #: shortcuts, you can change it in your kitty.conf to change the
327 #: modifiers for all the default shortcuts.
328
329 clear_all_shortcuts no
330
331 #: You can have kitty remove all shortcut definition seen up to this
332 #: point. Useful, for instance, to remove the default shortcuts.
333
334 kitten_alias hints hints --hints-offset=0 --alphabet="asonetuhid'l,r.cpgyf;zqvjwkmxb"
335
336 #: You can create aliases for kitten names, this allows overriding the
337 #: defaults for kitten options and can also be used to shorten
338 #: repeated mappings of the same kitten with a specific group of
339 #: options. For example, the above alias changes the default value of
340 #: kitty +kitten hints --hints-offset to zero for all mappings,
341 #: including the builtin ones.
342
343 #: Clipboard {{{
344
345 map kitty_mod+c copy_to_clipboard
346
347 #: There is also a copy_or_interrupt action that can be optionally
348 #: mapped to Ctrl+c. It will copy only if there is a selection and
349 #: send an interrupt otherwise. Similarly, copy_and_clear_or_interrupt
350 #: will copy and clear the selection or send an interrupt if there is
351 #: no selection.
352
353 map kitty_mod+v paste_from_clipboard
354 map kitty_mod+s paste_from_selection
355 map shift+insert paste_from_selection
356 map kitty_mod+o pass_selection_to_program
357
358 #: You can also pass the contents of the current selection to any
359 #: program using pass_selection_to_program. By default, the system's
360 #: open program is used, but you can specify your own, the selection
361 #: will be passed as a command line argument to the program, for
362 #: example::
363
364 #: map kitty_mod+o pass_selection_to_program firefox
365
366 #: You can pass the current selection to a terminal program running in
367 #: a new kitty window, by using the @selection placeholder::
368
369 #: map kitty_mod+y new_window less @selection
370
371 #: }}}
372
373 #: Scrolling {{{
374
375 map kitty_mod+up scroll_line_up
376 map kitty_mod+k scroll_line_up
377 map kitty_mod+down scroll_line_down
378 map kitty_mod+j scroll_line_down
379 map kitty_mod+page_up scroll_page_up
380 map kitty_mod+page_down scroll_page_down
381 map kitty_mod+home scroll_home
382 map kitty_mod+end scroll_end
383 map kitty_mod+h show_scrollback
384
385 #: You can pipe the contents of the current screen + history buffer as
386 #: STDIN to an arbitrary program using the ``launch`` function. For
387 #: example, the following opens the scrollback buffer in less in an
388 #: overlay window::
389
390 #: map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting --type=overlay less +G -R
391
392 #: For more details on piping screen and buffer contents to external
393 #: programs, see launch.
394
395 #: }}}
396
397 #: Window management {{{
398
399 map kitty_mod+enter new_window
400
401 #: You can open a new window running an arbitrary program, for
402 #: example::
403
404 #: map kitty_mod+y launch mutt
405
406 #: You can open a new window with the current working directory set to
407 #: the working directory of the current window using::
408
409 #: map ctrl+alt+enter launch --cwd=current
410
411 #: You can open a new window that is allowed to control kitty via the
412 #: kitty remote control facility by prefixing the command line with @.
413 #: Any programs running in that window will be allowed to control
414 #: kitty. For example::
415
416 #: map ctrl+enter launch --allow-remote-control some_program
417
418 #: You can open a new window next to the currently active window or as
419 #: the first window, with::
420
421 #: map ctrl+n launch --location=neighbor some_program
422 #: map ctrl+f launch --location=first some_program
423
424 #: For more details, see launch.
425
426 map kitty_mod+n new_os_window
427
428 #: Works like new_window above, except that it opens a top level OS
429 #: kitty window. In particular you can use new_os_window_with_cwd to
430 #: open a window with the current working directory.
431
432 map kitty_mod+w close_window
433 map kitty_mod+] next_window
434 map kitty_mod+[ previous_window
435 map kitty_mod+f move_window_forward
436 map kitty_mod+b move_window_backward
437 map kitty_mod+` move_window_to_top
438 map kitty_mod+r start_resizing_window
439 map kitty_mod+1 first_window
440 map kitty_mod+2 second_window
441 map kitty_mod+3 third_window
442 map kitty_mod+4 fourth_window
443 map kitty_mod+5 fifth_window
444 map kitty_mod+6 sixth_window
445 map kitty_mod+7 seventh_window
446 map kitty_mod+8 eighth_window
447 map kitty_mod+9 ninth_window
448 map kitty_mod+0 tenth_window
449 #: }}}
450
451 #: Tab management {{{
452
453 map kitty_mod+right next_tab
454 map kitty_mod+left previous_tab
455 map kitty_mod+t new_tab
456 map kitty_mod+q close_tab
457 map kitty_mod+. move_tab_forward
458 map kitty_mod+, move_tab_backward
459 map kitty_mod+alt+t set_tab_title
460
461 #: You can also create shortcuts to go to specific tabs, with 1 being
462 #: the first tab, 2 the second tab and -1 being the previously active
463 #: tab, and any number larger than the last tab being the last tab::
464
465 #: map ctrl+alt+1 goto_tab 1
466 #: map ctrl+alt+2 goto_tab 2
467
468 #: Just as with new_window above, you can also pass the name of
469 #: arbitrary commands to run when using new_tab and use
470 #: new_tab_with_cwd. Finally, if you want the new tab to open next to
471 #: the current tab rather than at the end of the tabs list, use::
472
473 #: map ctrl+t new_tab !neighbor [optional cmd to run]
474 #: }}}
475
476 #: Layout management {{{
477
478 map kitty_mod+l next_layout
479
480 #: You can also create shortcuts to switch to specific layouts::
481
482 #: map ctrl+alt+t goto_layout tall
483 #: map ctrl+alt+s goto_layout stack
484
485 #: Similarly, to switch back to the previous layout::
486
487 #: map ctrl+alt+p last_used_layout
488 #: }}}
489
490 #: Font sizes {{{
491
492 #: You can change the font size for all top-level kitty OS windows at
493 #: a time or only the current one.
494
495 map kitty_mod+equal change_font_size all +2.0
496 map kitty_mod+plus change_font_size all +2.0
497 map kitty_mod+kp_add change_font_size all +2.0
498 map kitty_mod+minus change_font_size all -2.0
499 map kitty_mod+kp_subtract change_font_size all -2.0
500 map kitty_mod+backspace change_font_size all 0
501
502 #: To setup shortcuts for specific font sizes::
503
504 #: map kitty_mod+f6 change_font_size all 10.0
505
506 #: To setup shortcuts to change only the current OS window's font
507 #: size::
508
509 #: map kitty_mod+f6 change_font_size current 10.0
510 #: }}}
511
512 #: Select and act on visible text {{{
513
514 #: Use the hints kitten to select text and either pass it to an
515 #: external program or insert it into the terminal or copy it to the
516 #: clipboard.
517
518 map kitty_mod+e kitten hints
519
520 #: Open a currently visible URL using the keyboard. The program used
521 #: to open the URL is specified in open_url_with.
522
523 map kitty_mod+p>f kitten hints --type path --program -
524
525 #: Select a path/filename and insert it into the terminal. Useful, for
526 #: instance to run git commands on a filename output from a previous
527 #: git command.
528
529 map kitty_mod+p>shift+f kitten hints --type path
530
531 #: Select a path/filename and open it with the default open program.
532
533 map kitty_mod+p>l kitten hints --type line --program -
534
535 #: Select a line of text and insert it into the terminal. Use for the
536 #: output of things like: ls -1
537
538 map kitty_mod+p>w kitten hints --type word --program -
539
540 #: Select words and insert into terminal.
541
542 map kitty_mod+p>h kitten hints --type hash --program -
543
544 #: Select something that looks like a hash and insert it into the
545 #: terminal. Useful with git, which uses sha1 hashes to identify
546 #: commits
547
548 map kitty_mod+p>n kitten hints --type linenum
549
550 #: Select something that looks like filename:linenum and open it in
551 #: vim at the specified line number.
552
553 map kitty_mod+p>y kitten hints --type hyperlink
554
555 #: Select a hyperlink (i.e. a URL that has been marked as such by the
556 #: terminal program, for example, by ls --hyperlink=auto).
557
558
559 #: The hints kitten has many more modes of operation that you can map
560 #: to different shortcuts. For a full description see kittens/hints.
561 #: }}}
562
563 #: Miscellaneous {{{
564
565 map kitty_mod+f11 toggle_fullscreen
566 map kitty_mod+f10 toggle_maximized
567 map kitty_mod+u kitten unicode_input
568 map kitty_mod+f2 edit_config_file
569 map kitty_mod+escape kitty_shell window
570
571 #: Open the kitty shell in a new window/tab/overlay/os_window to
572 #: control kitty using commands.
573
574 map kitty_mod+a>m set_background_opacity +0.1
575 map kitty_mod+a>l set_background_opacity -0.1
576 map kitty_mod+a>1 set_background_opacity 1
577 map kitty_mod+a>d set_background_opacity default
578 map kitty_mod+delete clear_terminal reset active
579
580 #: You can create shortcuts to clear/reset the terminal. For example::
581
582 #: # Reset the terminal
583 #: map kitty_mod+f9 clear_terminal reset active
584 #: # Clear the terminal screen by erasing all contents
585 #: map kitty_mod+f10 clear_terminal clear active
586 #: # Clear the terminal scrollback by erasing it
587 #: map kitty_mod+f11 clear_terminal scrollback active
588 #: # Scroll the contents of the screen into the scrollback
589 #: map kitty_mod+f12 clear_terminal scroll active
590
591 #: If you want to operate on all windows instead of just the current
592 #: one, use all instead of active.
593
594 #: It is also possible to remap Ctrl+L to both scroll the current
595 #: screen contents into the scrollback buffer and clear the screen,
596 #: instead of just clearing the screen::
597
598 #: map ctrl+l combine : clear_terminal scroll active : send_text normal,application \x0c
599
600
601 #: You can tell kitty to send arbitrary (UTF-8) encoded text to the
602 #: client program when pressing specified shortcut keys. For example::
603
604 #: map ctrl+alt+a send_text all Special text
605
606 #: This will send "Special text" when you press the ctrl+alt+a key
607 #: combination. The text to be sent is a python string literal so you
608 #: can use escapes like \x1b to send control codes or \u21fb to send
609 #: unicode characters (or you can just input the unicode characters
610 #: directly as UTF-8 text). The first argument to send_text is the
611 #: keyboard modes in which to activate the shortcut. The possible
612 #: values are normal or application or kitty or a comma separated
613 #: combination of them. The special keyword all means all modes. The
614 #: modes normal and application refer to the DECCKM cursor key mode
615 #: for terminals, and kitty refers to the special kitty extended
616 #: keyboard protocol.
617
618 #: Another example, that outputs a word and then moves the cursor to
619 #: the start of the line (same as pressing the Home key)::
620
621 #: map ctrl+alt+a send_text normal Word\x1b[H
622 #: map ctrl+alt+a send_text application Word\x1bOH
623
624 #: }}}
625
626 # }}}