basic.rst 7.5 KB

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