.. include:: /include/substitutions.txt .. include:: /include/external_links.txt .. include:: /include/custom_roles.txt .. _default key bindings windows: ****************************** Default Key Bindings (Windows) ****************************** For each table, a blank line means that keypress is not mapped in ``Default/Default (Windows).sublime-keymap``. Number Keys *********** .. include:: /include/windows/number_keys.txt Letter Keys *********** .. include:: /include/windows/letter_keys.txt Function Keys ************* **F-Key General Topics:** | F1 - | F2 - Bookmarks | F3 - Find | F4 - Build Results, Close File, Exit Sublime Text | F5 - | F6 - Spelling | F7 - Build (only one key mapped) | F8 - | F9 - Sort | F10 - | F11 - Screen State | F12 - Goto .. include:: /include/windows/function_keys.txt Symbol Keys *********** .. include:: /include/windows/symbol_keys.txt Named Keys ********** .. include:: /include/windows/named_keys.txt Tab Key ======= The :kbd:`Tab` key's behavior is context sensitive. The below are in top-to-bottom order from within the :term:`default key map`, so the top-most items are the most general, and the bottom-most items are the most specific, overriding the upper choices, but only when they apply. - Insert '\t' into View with focus. - Unless: - an auto-complete pop-up is NOT visible, and - no text is selected, and - tab_completion setting == true, and - caret is immediately after a word character (regex :regexp:`\\w`) - then, :kbd:`Tab` executes + "auto_complete", "args": {"mini": true, "default": "\t", "commit_single": true} - Unless: - same as above except tab_completion setting == false - then, :kbd:`Tab` executes + "auto_complete", "args": {"snippets_only": true, "default": "\t"} - Unless: - caret is in a context in which the keymap context condition "has_snippet" == true - then :kbd:`Tab` executes ``expand_snippet`` command with no arguments. - Unless: - setting.auto_indent == true, and - no text is selected for all carets, and - all carets are on a blank line (preceded and followed by empty strings), and - then :kbd:`Tab` executes ``reindent`` with no arguments. - Unless: - multiple lines are selected (selected text contains '\n') - then :kbd:`Tab` executes ``indent`` with no arguments. - Unless: - overlay_has_focus == true - then :kbd:`Tab` executes ``move`` with "args": {"by": "lines", "forward": true}. - Unless: - has_next_field == true - then :kbd:`Tab` executes ``next_field`` with no arguments. - Unless: - auto_complete_visible == true - then :kbd:`Tab` executes ``commit_completion`` with no arguments. Shift Tab ========= The :kbd:`Shift-Tab` is also context sensitive. In order from top-to-bottom in keymap (same ramifications as above): - Insert '\t' into View with focus. - Unless: - shift_tab_unindent == true - then :kbd:`Tab` executes ``unindent`` with no arguments. - Unless: - preceding_text matches :regexp:`^[\\t ]*` (caret is at BOL or preceeded only by whitespace) - then :kbd:`Tab` executes ``unindent`` with no arguments. - Unless: - multiple lines are selected (selected text contains '\n') - then :kbd:`Tab` executes ``unindent`` with no arguments. - Unless: - overlay_visible == true - then :kbd:`Tab` executes ``move`` with "args": {"by": "lines", "forward": false}. - Unless: - has_prev_field == true - then :kbd:`Tab` executes ``prev_field`` with no arguments (snippet or panel). Keypad Keys *********** For keyboards that have a keypad, you can also map these keys. On Windows systems, ``keypad0``-``keypad9`` keys are generally not useful to map in Sublime |nbsp| Text because most, if not all of them, are mapped by the OS to do other things, which makes them "appear" to be number keys, arrow keys, :kbd:`Home`, :kbd:`End`, :kbd:`Insert`,:kbd:`Delete`, :kbd:`PgUp` and :kbd:`PgDn` keys, etc. depending on the state of the :kbd:`NumLock` mode. For example, binding :kbd:`Alt-KeypadN` (where 'N' is [0-9]) keys does not work in Windows because the OS :term:`hooks ` these keypresses to produce input characters outside of the ASCII range. Example: - :kbd:`Alt-Keypad0` - :kbd:`Alt-Keypad2` - :kbd:`Alt-Keypad2` - :kbd:`Alt-Keypad5` followed by releasing the :kbd:`Alt` key produces ``รก``. Many otherwise-inaccessible characters, including many Unicode characters, can be produced on the keyboard this way. Thus, while these :term:`keypresses ` are listed below, they are not recommended to be mapped on Windows because the OS will most likely interfere with your use of them. Also, when :kbd:`NumLock` is OFF, the ``keypad_period`` key is mapped to the various :kbd:`...-Del` keypresses. However, keypresses with: - keypad_period (NumLock ON) - keypad_divide - keypad_multiply - keypad_minus - keypad_plus - keypad_enter are mapped by Sublime |nbsp| Text and work reliably and can be mapped or re-mapped as you see fit. .. container:: tighter-table-5 +---------+-+-+-+-------------------------------------------------------------------------------------+ |Key |A|C|S| Command | +=========+=+=+=+=====================================================================================+ |keypad0-9| | | | when ``NumLock`` ON, produces digits 0-9 respectively | +---------+-+-+-+-------------------------------------------------------------------------------------+ |keypad0-9| | | | when ``NumLock`` OFF, OS maps these to :kbd:`Insert`, :kbd:`End`, :kbd:`Down`, etc. | +---------+-+-+-+-------------------------------------------------------------------------------------+ |keypad0-9| | |x| when ``NumLock`` ON, OS maps these to :kbd:`Insert`, :kbd:`End`, :kbd:`Down`, etc. | +---------+-+-+-+-------------------------------------------------------------------------------------+ |keypad0-9| | |x| when ``NumLock`` OFF, OS maps these to :kbd:`Shift-Home`, :kbd:`Shift-End`, etc. | +---------+-+-+-+-------------------------------------------------------------------------------------+ |keypad0-9| |x| | when ``NumLock`` ON, OS maps these to :kbd:`Ctrl-Home`, :kbd:`Ctrl-End`, etc. | +---------+-+-+-+-------------------------------------------------------------------------------------+ |keypad0-9| |x| | when ``NumLock`` OFF, OS maps these to :kbd:`Ctrl-Home`, :kbd:`Ctrl-End`, etc. | +---------+-+-+-+-------------------------------------------------------------------------------------+ |keypad0-9| |x|x| when ``NumLock`` ON, OS maps these to :kbd:`Ctrl-Home`, :kbd:`Ctrl-End`, etc. | +---------+-+-+-+-------------------------------------------------------------------------------------+ |keypad0-9| |x|x| when ``NumLock`` OFF, OS maps these to :kbd:`Ctrl-Home`, :kbd:`Ctrl-End`, etc. | +---------+-+-+-+-------------------------------------------------------------------------------------+ |keypad0-9|x| | | when ``NumLock`` ON, OS maps these to producing special characters | +---------+-+-+-+-------------------------------------------------------------------------------------+ .. include:: /include/windows/keypad_keys.txt .. _ctrl-j key sequences: Leading Key: Ctrl-J ******************** In earlier versions of Sublime |nbsp| Text, the default key binding for :kbd:`Ctrl-J` was mapped to the ``join_lines`` command, which is similar to moving the caret to the end of the current line and hitting the ``Delete`` key, but it reduces all the whitespace between the two lines (including the newline between lines) to exactly 1 space, and the caret need not be at the end of the line when it is performed. This key binding was moved to :kbd:`Ctrl-Shift-J` in order to free up the :kbd:`Ctrl-J` key binding to be the leading key in a number of keypress sequences. ``["ctrl+j", "ctrl+j"]`` now opens a message box that explains how the previous binding of :kbd:`Ctrl-J` (join lines) was switched to :kbd:`Ctrl-Shift-J`. All of the remaining key sequences beginning with :kbd:`Ctrl-J` are now mapped to :ref:`side-by-side editing` Commands. In the table below, we use the term "select" in the same way we use that term in :ref:`side-by-side editing`, indicating that "selected" :term:`Sheets ` are temporarily participating (selected) in side-by-side editing. The term "select" is also used with the same meaning in the names of the :term:`Commands ` that these key sequences are mapped to (in the order they appear in the table): - unselect_others - unselect_to_left - select_to_left - unselect_to_right - select_to_right Keypresses with :kbd:`Shift` as a modifier ADD an adjacent :term:`View` to the set of "selected" Views with the arrow direction determining which View. Un-shifted key presses REMOVE an adjacent View from the set of "selected" Views. .. include:: /include/windows/multi-keypress_ctrl-j.txt Leading Key: Ctrl-K ******************** In the commands in the below table, "pane" and "group" both mean :term:`View Group`. In the order presented in the table: - new_pane (no args) - new_pane ("args": {"move": false}) - close_pane - focus_neighboring_group ("args": {"forward": false}) - move_to_neighboring_group ("args": {"forward": false}) - focus_neighboring_group (no args) - move_to_neighboring_group (no args) .. include:: /include/windows/multi-keypress_ctrl-k.txt .. note:: Regarding these commands, see :ref:`The Kill Ring` for more information. - delete_to_mark - yank Regarding these commands, see `Incremental Diff`_ for more details. - revert_hunk - revert_modification - toggle_inline_diff