1Tabs and Windows
2-------------------
3
4|kitty| is capable of running multiple programs organized into tabs and
5windows. The top level of organization is the *Tab*. Each tab consists
6of one or more *windows*. The windows can be arranged in multiple
7different layouts, like windows are organized in a tiling window
8manager. The keyboard controls (which are all customizable) for tabs and
9windows are:
10
11Scrolling
12~~~~~~~~~~~~~~
13
14========================    =======================
15Action                      Shortcut
16========================    =======================
17Scroll line up              :sc:`scroll_line_up` (also :kbd:`⌥+⌘+⇞` and :kbd:`⌘+↑` on macOS)
18Scroll line down            :sc:`scroll_line_down` (also :kbd:`⌥+⌘+⇟` and :kbd:`⌘+↓` on macOS)
19Scroll page up              :sc:`scroll_page_up` (also :kbd:`⌘+⇞` on macOS)
20Scroll page down            :sc:`scroll_page_down` (also :kbd:`⌘+⇟` on macOS)
21Scroll to top               :sc:`scroll_home` (also :kbd:`⌘+↖` on macOS)
22Scroll to bottom            :sc:`scroll_end` (also :kbd:`⌘+↘` on macOS)
23========================    =======================
24
25Tabs
26~~~~~~~~~~~
27
28========================    =======================
29Action                      Shortcut
30========================    =======================
31New tab                     :sc:`new_tab` (also :kbd:`⌘+t` on macOS)
32Close tab                   :sc:`close_tab` (also :kbd:`⌘+w` on macOS)
33Next tab                    :sc:`next_tab` (also :kbd:`^+⇥` and :kbd:`⇧+⌘+]` on macOS)
34Previous tab                :sc:`previous_tab` (also :kbd:`⇧+^+⇥` and :kbd:`⇧+⌘+[` on macOS)
35Next layout                 :sc:`next_layout`
36Move tab forward            :sc:`move_tab_forward`
37Move tab backward           :sc:`move_tab_backward`
38Set tab title               :sc:`set_tab_title` (also :kbd:`⇧+⌘+i` on macOS)
39========================    =======================
40
41
42Windows
43~~~~~~~~~~~~~~~~~~
44
45========================    =======================
46Action                      Shortcut
47========================    =======================
48New window                  :sc:`new_window` (also :kbd:`⌘+↩` on macOS)
49New OS window               :sc:`new_os_window` (also :kbd:`⌘+n` on macOS)
50Close window                :sc:`close_window` (also :kbd:`⇧+⌘+d` on macOS)
51Next window                 :sc:`next_window`
52Previous window             :sc:`previous_window`
53Move window forward         :sc:`move_window_forward`
54Move window backward        :sc:`move_window_backward`
55Move window to top          :sc:`move_window_to_top`
56Focus specific window       :sc:`first_window`, :sc:`second_window` ... :sc:`tenth_window`
57                            (also :kbd:`⌘+1`, :kbd:`⌘+2` ... :kbd:`⌘+9` on macOS)
58                            (clockwise from the top-left)
59========================    =======================
60
61Additionally, you can define shortcuts in :file:`kitty.conf` to focus neighboring
62windows and move windows around (similar to window movement in vim)::
63
64   map ctrl+left neighboring_window left
65   map shift+left move_window right
66   map ctrl+down neighboring_window down
67   map shift+down move_window up
68   ...
69
70You can also define a shortcut to switch to the previously active window::
71
72   map ctrl+p nth_window -1
73
74``nth_window`` will focus the nth window for positive numbers and the
75previously active windows for negative numbers.
76
77.. _detach_window:
78
79You can define shortcuts to detach the current window and
80move it to another tab or another OS window::
81
82    # moves the window into a new OS window
83    map ctrl+f2 detach_window
84    # moves the window into a new Tab
85    map ctrl+f3 detach_window new-tab
86    # moves the window into the previously active tab
87    map ctrl+f3 detach_window tab-prev
88    # moves the window into the tab at the left of the active tab
89    map ctrl+f3 detach_window tab-left
90    # asks which tab to move the window into
91    map ctrl+f4 detach_window ask
92
93Similarly, you can detach the current tab, with::
94
95    # moves the tab into a new OS window
96    map ctrl+f2 detach_tab
97    # asks which OS Window to move the tab into
98    map ctrl+f4 detach_tab ask
99
100Finally, you can define a shortcut to close all windows in a tab other than
101the currently active window::
102
103    map f9 close_other_windows_in_tab
104
105
106Other keyboard shortcuts
107----------------------------------
108
109The full list of actions that can be mapped to key presses is available
110:doc:`here </actions>`.
111
112==================================  =======================
113Action                              Shortcut
114==================================  =======================
115Copy to clipboard                   :sc:`copy_to_clipboard` (also :kbd:`⌘+c` on macOS)
116Paste from clipboard                :sc:`paste_from_clipboard` (also :kbd:`⌘+v` on macOS)
117Paste from selection                :sc:`paste_from_selection`
118Increase font size                  :sc:`increase_font_size` (also :kbd:`⌘++` on macOS)
119Decrease font size                  :sc:`decrease_font_size` (also :kbd:`⌘+-` on macOS)
120Restore font size                   :sc:`reset_font_size` (also :kbd:`⌘+0` on macOS)
121Toggle fullscreen                   :sc:`toggle_fullscreen` (also :kbd:`^+⌘+f` on macOS)
122Toggle maximized                    :sc:`toggle_maximized`
123Input unicode character             :sc:`input_unicode_character` (also :kbd:`^+⌘+space` on macOS)
124Click URL using the keyboard        :sc:`open_url`
125Reset the terminal                  :sc:`reset_terminal`
126Reload :file:`kitty.conf`           :sc:`reload_config_file` (also :kbd:`^+⌘+f5` on macOS)
127Debug :file:`kitty.conf`            :sc:`debug_config` (also :kbd:`⌘+option+f6` on macOS)
128Pass current selection to program   :sc:`pass_selection_to_program`
129Edit |kitty| config file            :sc:`edit_config_file`
130Open a |kitty| shell                :sc:`kitty_shell`
131Increase background opacity         :sc:`increase_background_opacity`
132Decrease background opacity         :sc:`decrease_background_opacity`
133Full background opacity             :sc:`full_background_opacity`
134Reset background opacity            :sc:`reset_background_opacity`
135==================================  =======================
136