Add more common macOS keyboard shortcuts

This commit is contained in:
Luflosi 2019-01-22 01:09:12 +01:00
parent aa82d8fddd
commit 0d60b88f1d
No known key found for this signature in database
GPG Key ID: 14140F703B7D8362
3 changed files with 59 additions and 25 deletions

View File

@ -21,6 +21,7 @@ Changelog
- Fix window title for minimized windows not being updated (:iss:`1332`)
- macOS: Add a bunch of common macOS keyboard shortcuts
0.13.3 [2019-01-19]
------------------------------

View File

@ -108,12 +108,12 @@ Scrolling
======================== =======================
Action Shortcut
======================== =======================
Scroll line up :sc:`scroll_line_up`
Scroll line down :sc:`scroll_line_down`
Scroll page up :sc:`scroll_page_up`
Scroll page down :sc:`scroll_page_down`
Scroll to top :sc:`scroll_home`
Scroll to bottom :sc:`scroll_end`
Scroll line up :sc:`scroll_line_up` (also :kbd:`⌥+⌘+⇞` and :kbd:`⌘+↑` on macOS)
Scroll line down :sc:`scroll_line_down` (also :kbd:`⌥+⌘+⇟` and :kbd:`⌘+↓` on macOS)
Scroll page up :sc:`scroll_page_up` (also :kbd:`⌘+⇞` on macOS)
Scroll page down :sc:`scroll_page_down` (also :kbd:`⌘+⇟` on macOS)
Scroll to top :sc:`scroll_home` (also :kbd:`⌘+↖` on macOS)
Scroll to bottom :sc:`scroll_end` (also :kbd:`⌘+↘` on macOS)
======================== =======================
Tabs
@ -123,13 +123,14 @@ Tabs
Action Shortcut
======================== =======================
New tab :sc:`new_tab` (also :kbd:`⌘+t` on macOS)
Close tab :sc:`close_tab`
Next tab :sc:`next_tab` (also :kbd:`control+tab` on macOS)
Previous tab :sc:`previous_tab` (also :kbd:`control+shift+tab` on macOS)
New tab with cwd :sc:`new_tab_with_cwd` (also :kbd:`⇧+⌘+t` on macOS)
Close tab :sc:`close_tab` (also :kbd:`⌘+w` on macOS)
Next tab :sc:`next_tab` (also :kbd:`^+⇥` on macOS)
Previous tab :sc:`previous_tab` (also :kbd:`⇧+^+⇥` on macOS)
Next layout :sc:`next_layout`
Move tab forward :sc:`move_tab_forward`
Move tab backward :sc:`move_tab_backward`
Set tab title :sc:`set_tab_title`
Set tab title :sc:`set_tab_title` (also :kbd:`⇧+⌘+i` on macOS)
======================== =======================
@ -141,7 +142,8 @@ Action Shortcut
======================== =======================
New window :sc:`new_window`
New OS window :sc:`new_os_window` (also :kbd:`⌘+n` on macOS)
Close window :sc:`close_window` (also :kbd:`⌘+w` on macOS)
New OS window with cwd :sc:`new_os_window_with_cwd` (also :kbd:`⇧+⌘+n` on macOS)
Close window :sc:`close_window` (also :kbd:`⇧+⌘+d` on macOS)
Next window :sc:`next_window`
Previous window :sc:`previous_window`
Move window forward :sc:`move_window_forward`
@ -177,13 +179,13 @@ Action Shortcut
Copy to clipboard :sc:`copy_to_clipboard` (also :kbd:`⌘+c` on macOS)
Paste from clipboard :sc:`paste_from_clipboard` (also :kbd:`⌘+v` on macOS)
Paste from selection :sc:`paste_from_selection`
Increase font size :sc:`increase_font_size`
Decrease font size :sc:`decrease_font_size`
Restore font size :sc:`reset_font_size`
Toggle fullscreen :sc:`toggle_fullscreen` (also :kbd:`^⌘+f` on macOS)
Increase font size :sc:`increase_font_size` (also :kbd:`⌘++` on macOS)
Decrease font size :sc:`decrease_font_size` (also :kbd:`⌘+-` on macOS)
Restore font size :sc:`reset_font_size` (also :kbd:`⌘+0` on macOS)
Toggle fullscreen :sc:`toggle_fullscreen` (also :kbd:`^+⌘+f` on macOS)
Input unicode character :sc:`input_unicode_character`
Click URL using the keyboard :sc:`open_url`
Reset the terminal :sc:`reset_terminal`
Reset the terminal :sc:`reset_terminal` (also :kbd:`⌘+r` on macOS)
Pass current selection to program :sc:`pass_selection_to_program`
Edit |kitty| config file :sc:`edit_config_file`
Open a |kitty| shell :sc:`kitty_shell`

View File

@ -854,13 +854,14 @@ You can have kitty remove all shortcut definition seen up to this point. Useful,
instance, to remove the default shortcuts.'''))
g('shortcuts.clipboard') # {{{
if is_macos:
k('copy_to_clipboard', 'cmd+c', 'copy_to_clipboard', _('Copy to clipboard'), add_to_docs=False)
k('paste_from_clipboard', 'cmd+v', 'paste_from_clipboard', _('Paste from clipboard'), add_to_docs=False)
k('copy_to_clipboard', 'kitty_mod+c', 'copy_to_clipboard', _('Copy to clipboard'), long_text=_('''
There is also a :code:`copy_or_interrupt` action that can be optionally mapped to :kbd:`Ctrl+c`.
It will copy only if there is a selection and send an interrupt otherwise.'''))
if is_macos:
k('copy_to_clipboard', 'cmd+c', 'copy_to_clipboard', _('Copy to clipboard'), add_to_docs=False)
k('paste_from_clipboard', 'kitty_mod+v', 'paste_from_clipboard', _('Paste from clipboard'))
if is_macos:
k('paste_from_clipboard', 'cmd+v', 'paste_from_clipboard', _('Paste from clipboard'), add_to_docs=False)
k('paste_from_selection', 'kitty_mod+s', 'paste_from_selection', _('Paste from selection'))
k('paste_from_selection', 'shift+insert', 'paste_from_selection', _('Paste from selection'))
k('pass_selection_to_program', 'kitty_mod+o', 'pass_selection_to_program', _('Pass selection to program'), long_text=_('''
@ -880,13 +881,27 @@ window, by using the @selection placeholder::
g('shortcuts.scrolling') # {{{
k('scroll_line_up', 'kitty_mod+up', 'scroll_line_up', _('Scroll line up'))
if is_macos:
k('scroll_line_up', 'alt+cmd+page_up', 'scroll_line_up', _('Scroll line up'), add_to_docs=False)
k('scroll_line_up', 'cmd+up', 'scroll_line_up', _('Scroll line up'), add_to_docs=False)
k('scroll_line_up', 'kitty_mod+k', 'scroll_line_up')
k('scroll_line_down', 'kitty_mod+down', 'scroll_line_down', _('Scroll line down'))
k('scroll_line_down', 'kitty_mod+j', 'scroll_line_down')
if is_macos:
k('scroll_line_down', 'alt+cmd+page_down', 'scroll_line_down', _('Scroll line down'), add_to_docs=False)
k('scroll_line_down', 'cmd+down', 'scroll_line_down', _('Scroll line down'), add_to_docs=False)
k('scroll_page_up', 'kitty_mod+page_up', 'scroll_page_up', _('Scroll page up'))
if is_macos:
k('scroll_page_up', 'cmd+page_up', 'scroll_page_up', _('Scroll page up'), add_to_docs=False)
k('scroll_page_down', 'kitty_mod+page_down', 'scroll_page_down', _('Scroll page down'))
if is_macos:
k('scroll_page_down', 'cmd+page_down', 'scroll_page_down', _('Scroll page down'), add_to_docs=False)
k('scroll_home', 'kitty_mod+home', 'scroll_home', _('Scroll to top'))
if is_macos:
k('scroll_home', 'cmd+home', 'scroll_home', _('Scroll to top'), add_to_docs=False)
k('scroll_end', 'kitty_mod+end', 'scroll_end', _('Scroll to bottom'))
if is_macos:
k('scroll_end', 'cmd+end', 'scroll_end', _('Scroll to bottom'), add_to_docs=False)
k('show_scrollback', 'kitty_mod+h', 'show_scrollback', _('Browse scrollback buffer in less'), long_text=_('''
You can pipe the contents of the current screen + history buffer as
@ -920,12 +935,13 @@ For example::
map ctrl+enter new_window @ some_program
'''))
if is_macos:
k('new_os_window', 'cmd+n', 'new_os_window', _('New OS window'))
k('new_os_window', 'kitty_mod+n', 'new_os_window', _('New OS window'))
if is_macos:
k('new_os_window', 'cmd+n', 'new_os_window', _('New OS window'), add_to_docs=False)
k('new_os_window_with_cwd', 'shift+cmd+n', 'new_os_window_with_cwd', _('New OS window with cwd'), add_to_docs=False)
k('close_window', 'kitty_mod+w', 'close_window', _('Close window'))
if is_macos:
k('close_window', 'cmd+w', 'close_window', _('Close window'), add_to_docs=False)
k('close_window', 'shift+cmd+d', 'close_window', _('Close window'), add_to_docs=False)
k('next_window', 'kitty_mod+]', 'next_window', _('Next window'))
k('previous_window', 'kitty_mod+[', 'previous_window', _('Previous window'))
k('move_window_forward', 'kitty_mod+f', 'move_window_forward', _('Move window forward'))
@ -945,19 +961,26 @@ k('tenth_window', 'kitty_mod+0', 'tenth_window', _('Tenth window'))
# }}}
g('shortcuts.tab') # {{{
if is_macos:
k('next_tab', 'ctrl+tab', 'next_tab', _('Next tab'), add_to_docs=False)
k('next_tab', 'kitty_mod+right', 'next_tab', _('Next tab'))
if is_macos:
k('previous_tab', 'ctrl+shift+tab', 'previous_tab', _('Previous tab'), add_to_docs=False)
k('next_tab', 'ctrl+tab', 'next_tab', _('Next tab'), add_to_docs=False)
k('previous_tab', 'kitty_mod+left', 'previous_tab', _('Previous tab'))
if is_macos:
k('previous_tab', 'shift+ctrl+tab', 'previous_tab', _('Previous tab'), add_to_docs=False)
k('new_tab', 'kitty_mod+t', 'new_tab', _('New tab'))
if is_macos:
k('new_tab', 'cmd+t', 'new_tab', _('New tab'), add_to_docs=False)
k('new_tab_with_cwd', 'shift+cmd+t', 'new_tab_with_cwd', _('New tab with cwd'), add_to_docs=False)
k('close_tab', 'kitty_mod+q', 'close_tab', _('Close tab'))
if is_macos:
k('close_tab', 'cmd+w', 'close_tab', _('Close tab'), add_to_docs=False)
# Not yet implemented
# k('close_os_window', 'shift+cmd+w', 'close_os_window', _('Close os window'), add_to_docs=False)
k('move_tab_forward', 'kitty_mod+.', 'move_tab_forward', _('Move tab forward'))
k('move_tab_backward', 'kitty_mod+,', 'move_tab_backward', _('Move tab backward'))
k('set_tab_title', 'kitty_mod+alt+t', 'set_tab_title', _('Set tab title'))
if is_macos:
k('set_tab_title', 'shift+cmd+i', 'set_tab_title', _('Set tab title'), add_to_docs=False)
# }}}
g('shortcuts.layout') # {{{
@ -966,8 +989,14 @@ k('next_layout', 'kitty_mod+l', 'next_layout', _('Next layout'))
g('shortcuts.fonts') # {{{
k('increase_font_size', 'kitty_mod+equal', 'change_font_size all +2.0', _('Increase font size'))
if is_macos:
k('increase_font_size', 'cmd+plus', 'change_font_size all +2.0', _('Increase font size'), add_to_docs=False)
k('decrease_font_size', 'kitty_mod+minus', 'change_font_size all -2.0', _('Decrease font size'))
if is_macos:
k('decrease_font_size', 'cmd+minus', 'change_font_size all -2.0', _('Decrease font size'), add_to_docs=False)
k('reset_font_size', 'kitty_mod+backspace', 'change_font_size all 0', _('Reset font size'))
if is_macos:
k('reset_font_size', 'cmd+0', 'change_font_size all 0', _('Reset font size'), add_to_docs=False)
# }}}
g('shortcuts.selection') # {{{
@ -1005,6 +1034,8 @@ k('increase_background_opacity', 'kitty_mod+a>m', 'set_background_opacity +0.1',
k('decrease_background_opacity', 'kitty_mod+a>l', 'set_background_opacity -0.1', _('Decrease background opacity'))
k('full_background_opacity', 'kitty_mod+a>1', 'set_background_opacity 1', _('Make background fully opaque'))
k('reset_background_opacity', 'kitty_mod+a>d', 'set_background_opacity default', _('Reset background opacity'))
if is_macos:
k('reset_terminal', 'cmd+r', 'clear_terminal reset active', _('Reset the terminal'), add_to_docs=False)
k('reset_terminal', 'kitty_mod+delete', 'clear_terminal reset active', _('Reset the terminal'),
long_text=_('''
You can create shortcuts to clear/reset the terminal. For example::