]> git.rmz.io Git - dotfiles.git/blob - kitty/kitty.conf
lazyvim: absorb snacks notifier
[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 rifle
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 with the mouse or by using the hints
247 #: kitten <https://sw.kovidgoyal.net/kitty/kittens/hints/>. The
248 #: special value of ask means that kitty will ask before opening the
249 #: link when clicked.
250
251 shell_integration no-sudo
252
253
254 term xterm-kitty
255
256 #: The value of the TERM environment variable to set. Changing this
257 #: can break many terminal programs, only change it if you know what
258 #: you are doing, not because you read some advice on Stack Overflow
259 #: to change it. The TERM variable is used by various programs to get
260 #: information about the capabilities and behavior of the terminal. If
261 #: you change it, depending on what programs you run, and how
262 #: different the terminal you are changing it to is, various things
263 #: from key-presses, to colors, to various advanced features may not
264 #: work.
265
266 #: }}}
267
268 #: Keyboard shortcuts {{{
269
270 #: Keys are identified simply by their lowercase unicode characters.
271 #: For example: ``a`` for the A key, ``[`` for the left square bracket
272 #: key, etc. For functional keys, such as ``Enter or Escape`` the
273 #: names are present at https://sw.kovidgoyal.net/kitty/keyboard-
274 #: protocol.html#functional-key-definitions. For a list of modifier
275 #: names, see: GLFW mods
276 #: <https://www.glfw.org/docs/latest/group__mods.html>
277
278 #: On Linux you can also use XKB key names to bind keys that are not
279 #: supported by GLFW. See XKB keys
280 #: <https://github.com/xkbcommon/libxkbcommon/blob/master/xkbcommon/xkbcommon-
281 #: keysyms.h> for a list of key names. The name to use is the part
282 #: after the XKB_KEY_ prefix. Note that you can only use an XKB key
283 #: name for keys that are not known as GLFW keys.
284
285 #: Finally, you can use raw system key codes to map keys, again only
286 #: for keys that are not known as GLFW keys. To see the system key
287 #: code for a key, start kitty with the kitty --debug-keyboard option.
288 #: Then kitty will output some debug text for every key event. In that
289 #: text look for ``native_code`` the value of that becomes the key
290 #: name in the shortcut. For example:
291
292 #: .. code-block:: none
293
294 #: on_key_input: glfw key: 65 native_code: 0x61 action: PRESS mods: 0x0 text: 'a'
295
296 #: Here, the key name for the A key is 0x61 and you can use it with::
297
298 #: map ctrl+0x61 something
299
300 #: to map ctrl+a to something.
301
302 #: You can use the special action no_op to unmap a keyboard shortcut
303 #: that is assigned in the default configuration::
304
305 #: map kitty_mod+space no_op
306
307 #: You can combine multiple actions to be triggered by a single
308 #: shortcut, using the syntax below::
309
310 #: map key combine <separator> action1 <separator> action2 <separator> action3 ...
311
312 #: For example::
313
314 #: map kitty_mod+e combine : new_window : next_layout
315
316 #: this will create a new window and switch to the next available
317 #: layout
318
319 #: You can use multi-key shortcuts using the syntax shown below::
320
321 #: map key1>key2>key3 action
322
323 #: For example::
324
325 #: map ctrl+f>2 set_font_size 20
326
327 kitty_mod ctrl+shift
328
329 #: The value of kitty_mod is used as the modifier for all default
330 #: shortcuts, you can change it in your kitty.conf to change the
331 #: modifiers for all the default shortcuts.
332
333 clear_all_shortcuts no
334
335 #: You can have kitty remove all shortcut definition seen up to this
336 #: point. Useful, for instance, to remove the default shortcuts.
337
338 kitten_alias hints hints --hints-offset=0 --alphabet="asonetuhid'l,r.cpgyf;zqvjwkmxb"
339
340 #: You can create aliases for kitten names, this allows overriding the
341 #: defaults for kitten options and can also be used to shorten
342 #: repeated mappings of the same kitten with a specific group of
343 #: options. For example, the above alias changes the default value of
344 #: kitty +kitten hints --hints-offset to zero for all mappings,
345 #: including the builtin ones.
346
347 #: Clipboard {{{
348
349 map kitty_mod+c copy_to_clipboard
350
351 #: There is also a copy_or_interrupt action that can be optionally
352 #: mapped to Ctrl+c. It will copy only if there is a selection and
353 #: send an interrupt otherwise. Similarly, copy_and_clear_or_interrupt
354 #: will copy and clear the selection or send an interrupt if there is
355 #: no selection.
356
357 map kitty_mod+v paste_from_clipboard
358 map kitty_mod+s paste_from_selection
359 map shift+insert paste_from_selection
360 map kitty_mod+o pass_selection_to_program
361
362 #: You can also pass the contents of the current selection to any
363 #: program using pass_selection_to_program. By default, the system's
364 #: open program is used, but you can specify your own, the selection
365 #: will be passed as a command line argument to the program, for
366 #: example::
367
368 #: map kitty_mod+o pass_selection_to_program firefox
369
370 #: You can pass the current selection to a terminal program running in
371 #: a new kitty window, by using the @selection placeholder::
372
373 #: map kitty_mod+y new_window less @selection
374
375 #: }}}
376
377 #: Scrolling {{{
378
379 map kitty_mod+up scroll_line_up
380 map kitty_mod+k scroll_line_up
381 map kitty_mod+down scroll_line_down
382 map kitty_mod+j scroll_line_down
383 map kitty_mod+page_up scroll_page_up
384 map shift+page_up scroll_page_up
385 map kitty_mod+page_down scroll_page_down
386 map shift+page_down scroll_page_down
387 map kitty_mod+home scroll_home
388 map kitty_mod+end scroll_end
389 map kitty_mod+h show_scrollback
390
391 #: You can pipe the contents of the current screen + history buffer as
392 #: STDIN to an arbitrary program using the ``launch`` function. For
393 #: example, the following opens the scrollback buffer in less in an
394 #: overlay window::
395
396 #: map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting --type=overlay less +G -R
397
398 #: For more details on piping screen and buffer contents to external
399 #: programs, see launch.
400
401 #: }}}
402
403 #: Window management {{{
404
405 map kitty_mod+enter new_window
406
407 #: You can open a new window running an arbitrary program, for
408 #: example::
409
410 #: map kitty_mod+y launch mutt
411
412 #: You can open a new window with the current working directory set to
413 #: the working directory of the current window using::
414
415 #: map ctrl+alt+enter launch --cwd=current
416
417 #: You can open a new window that is allowed to control kitty via the
418 #: kitty remote control facility by prefixing the command line with @.
419 #: Any programs running in that window will be allowed to control
420 #: kitty. For example::
421
422 #: map ctrl+enter launch --allow-remote-control some_program
423
424 #: You can open a new window next to the currently active window or as
425 #: the first window, with::
426
427 #: map ctrl+n launch --location=neighbor some_program
428 #: map ctrl+f launch --location=first some_program
429
430 #: For more details, see launch.
431
432 map kitty_mod+n new_os_window
433
434 #: Works like new_window above, except that it opens a top level OS
435 #: kitty window. In particular you can use new_os_window_with_cwd to
436 #: open a window with the current working directory.
437
438 map kitty_mod+w close_window
439 map kitty_mod+] next_window
440 map kitty_mod+[ previous_window
441 # map kitty_mod+f move_window_forward
442 map kitty_mod+b move_window_backward
443 map kitty_mod+` move_window_to_top
444 map kitty_mod+r start_resizing_window
445 map kitty_mod+1 first_window
446 map kitty_mod+2 second_window
447 map kitty_mod+3 third_window
448 map kitty_mod+4 fourth_window
449 map kitty_mod+5 fifth_window
450 map kitty_mod+6 sixth_window
451 map kitty_mod+7 seventh_window
452 map kitty_mod+8 eighth_window
453 map kitty_mod+9 ninth_window
454 map kitty_mod+0 tenth_window
455 #: }}}
456
457 #: Tab management {{{
458
459 map kitty_mod+right next_tab
460 map kitty_mod+left previous_tab
461 map kitty_mod+t new_tab
462 map kitty_mod+q close_tab
463 map kitty_mod+. move_tab_forward
464 map kitty_mod+, move_tab_backward
465 map kitty_mod+alt+t set_tab_title
466
467 #: You can also create shortcuts to go to specific tabs, with 1 being
468 #: the first tab, 2 the second tab and -1 being the previously active
469 #: tab, and any number larger than the last tab being the last tab::
470
471 #: map ctrl+alt+1 goto_tab 1
472 #: map ctrl+alt+2 goto_tab 2
473
474 #: Just as with new_window above, you can also pass the name of
475 #: arbitrary commands to run when using new_tab and use
476 #: new_tab_with_cwd. Finally, if you want the new tab to open next to
477 #: the current tab rather than at the end of the tabs list, use::
478
479 #: map ctrl+t new_tab !neighbor [optional cmd to run]
480 #: }}}
481
482 #: Layout management {{{
483
484 map kitty_mod+l next_layout
485
486 #: You can also create shortcuts to switch to specific layouts::
487
488 #: map ctrl+alt+t goto_layout tall
489 #: map ctrl+alt+s goto_layout stack
490
491 #: Similarly, to switch back to the previous layout::
492
493 #: map ctrl+alt+p last_used_layout
494 #: }}}
495
496 #: Font sizes {{{
497
498 #: You can change the font size for all top-level kitty OS windows at
499 #: a time or only the current one.
500
501 map kitty_mod+equal change_font_size all +2.0
502 map kitty_mod+plus change_font_size all +2.0
503 map kitty_mod+kp_add change_font_size all +2.0
504 map kitty_mod+minus change_font_size all -2.0
505 map kitty_mod+kp_subtract change_font_size all -2.0
506 map kitty_mod+backspace change_font_size all 0
507
508 #: To setup shortcuts for specific font sizes::
509
510 #: map kitty_mod+f6 change_font_size all 10.0
511
512 #: To setup shortcuts to change only the current OS window's font
513 #: size::
514
515 #: map kitty_mod+f6 change_font_size current 10.0
516 #: }}}
517
518 #: Select and act on visible text {{{
519
520 #: Use the hints kitten to select text and either pass it to an
521 #: external program or insert it into the terminal or copy it to the
522 #: clipboard.
523
524 map kitty_mod+f kitten hints
525
526 #: Open a currently visible URL using the keyboard. The program used
527 #: to open the URL is specified in open_url_with.
528
529 map kitty_mod+p>f kitten hints --type path --program -
530
531 #: Select a path/filename and insert it into the terminal. Useful, for
532 #: instance to run git commands on a filename output from a previous
533 #: git command.
534
535 map kitty_mod+p>shift+f kitten hints --type path
536
537 #: Select a path/filename and open it with the default open program.
538
539 map kitty_mod+p>l kitten hints --type line --program -
540
541 #: Select a line of text and insert it into the terminal. Use for the
542 #: output of things like: ls -1
543
544 map kitty_mod+p>w kitten hints --type word --program -
545
546 #: Select words and insert into terminal.
547
548 map kitty_mod+p>h kitten hints --type hash --program -
549
550 #: Select something that looks like a hash and insert it into the
551 #: terminal. Useful with git, which uses sha1 hashes to identify
552 #: commits
553
554 map kitty_mod+p>n kitten hints --type linenum
555
556 #: Select something that looks like filename:linenum and open it in
557 #: vim at the specified line number.
558
559 map kitty_mod+p>y kitten hints --type hyperlink
560
561 #: Select a hyperlink (i.e. a URL that has been marked as such by the
562 #: terminal program, for example, by ls --hyperlink=auto).
563
564
565 #: The hints kitten has many more modes of operation that you can map
566 #: to different shortcuts. For a full description see kittens/hints.
567 #: }}}
568
569 #: Miscellaneous {{{
570
571 map kitty_mod+f11 toggle_fullscreen
572 map kitty_mod+f10 toggle_maximized
573 map kitty_mod+u kitten unicode_input
574 map kitty_mod+f2 edit_config_file
575 map kitty_mod+escape kitty_shell window
576
577 #: Open the kitty shell in a new window/tab/overlay/os_window to
578 #: control kitty using commands.
579
580 map kitty_mod+a>m set_background_opacity +0.1
581 map kitty_mod+a>l set_background_opacity -0.1
582 map kitty_mod+a>1 set_background_opacity 1
583 map kitty_mod+a>d set_background_opacity default
584 map kitty_mod+delete clear_terminal reset active
585
586 #: You can create shortcuts to clear/reset the terminal. For example::
587
588 #: # Reset the terminal
589 #: map kitty_mod+f9 clear_terminal reset active
590 #: # Clear the terminal screen by erasing all contents
591 #: map kitty_mod+f10 clear_terminal clear active
592 #: # Clear the terminal scrollback by erasing it
593 #: map kitty_mod+f11 clear_terminal scrollback active
594 #: # Scroll the contents of the screen into the scrollback
595 #: map kitty_mod+f12 clear_terminal scroll active
596
597 #: If you want to operate on all windows instead of just the current
598 #: one, use all instead of active.
599
600 #: It is also possible to remap Ctrl+L to both scroll the current
601 #: screen contents into the scrollback buffer and clear the screen,
602 #: instead of just clearing the screen::
603
604 #: map ctrl+l combine : clear_terminal scroll active : send_text normal,application \x0c
605
606
607 #: You can tell kitty to send arbitrary (UTF-8) encoded text to the
608 #: client program when pressing specified shortcut keys. For example::
609
610 #: map ctrl+alt+a send_text all Special text
611
612 #: This will send "Special text" when you press the ctrl+alt+a key
613 #: combination. The text to be sent is a python string literal so you
614 #: can use escapes like \x1b to send control codes or \u21fb to send
615 #: unicode characters (or you can just input the unicode characters
616 #: directly as UTF-8 text). The first argument to send_text is the
617 #: keyboard modes in which to activate the shortcut. The possible
618 #: values are normal or application or kitty or a comma separated
619 #: combination of them. The special keyword all means all modes. The
620 #: modes normal and application refer to the DECCKM cursor key mode
621 #: for terminals, and kitty refers to the special kitty extended
622 #: keyboard protocol.
623
624 #: Another example, that outputs a word and then moves the cursor to
625 #: the start of the line (same as pressing the Home key)::
626
627 #: map ctrl+alt+a send_text normal Word\x1b[H
628 #: map ctrl+alt+a send_text application Word\x1bOH
629
630 #: }}}
631
632 # }}}