Key Bindings for ash

August 31, 2022 · View on GitHub

The following is a list of default key bindings for ash. All of these can be remapped as per the user's preferences by creating new keymaps in the ~/.config/ash-editor/keymaps/ directory. The default keymap is stored in the file 'default.json'.

Global key combinations

These key combinations can be used even if no editor is currently active.

KeyAction
Ctrl + QClose the active window
Ctrl + @Forcefully quit the application, discarding all changes
Tab or Ctrl + ISwitch focus to the next widget in the active dialog-box (if any)
Shift + TabSwitch focus to the previous widget in the active dialog-box
Ctrl + Move the active dialog-box around the screen
SpaceCheck/Uncheck a checkbox in focus
Enter or Ctrl + W or Ctrl + JSave changes and close the current dialog box
Alt + Open the top-level menu
Alt + Close/hide the top-level menu
Ctrl + LShow the list of active buffers/files
Ctrl + TShow the list of active tabs
Ctrl + NOpen a new buffer for editing
Ctrl + OOpen a file
Ctrl + EOpen project explorer (if directory has been opened)
F1Show Help
F2Show the list of recently opened files
F3Switch to previous editor
F4Switch to next editor
F5Switch to previous tab
F6Switch to next tab
F11Toggle fullscreen
Ctrl + F1Shows/hides filenames in non-active editors
Ctrl + F2Create a new tab
Ctrl + F3Split horizontally
Ctrl + F4Split vertically
Ctrl + F5Merge horizontally
Ctrl + F6Merge vertically
Ctrl + F7Close the active tab
Ctrl + F9Close all editors in the active-tab except the active-editor
Esc or Ctrl + [Show the command window
F12Search in all open files/buffers
Ctrl + F12Search/Replace in all open files/buffers

Apart from the above, selection and cursor-movement using Shift and/or arrow / Home / End keys, as well as Cut / Copy / Paste (using Ctrl + X / C / V respectively) work in all text-fields (wherever they occur in dialog-boxes).

Editor commands

These key combinations work only if an editor is currently active.

KeyAction
Alt + or Right-ClickOpen popup menu
Move the cursor in the document one character/line at a time
Ctrl + Move the cursor one word at a time
PgUp PgDownMove the cursor in the document one screenful at a time
Home EndMove the cursor to the beginning/end of the current line
Ctrl + Home EndMove the cursor to the beginning/end of the current document
TabInsert tab OR Increase the indent of the selection
Shift + TabDecrease the indent of the selection if possible
Shift + Home EndSelect text up to the beginning/end of the current line
Shift + Select text one character at a time
Shift + PgUp PgDownSelect one screenful at a time
Ctrl + ASelect all
Ctrl + CCopy
Ctrl + XCut
Ctrl + VPaste
BackspaceDelete the character/selected-text before the cursor
DelDelete the selected-text or, character at the cursor position
Ctrl + F2Convert all Uncode escape sequences (\uxxxx) to Unicode characters, and also sets file encoding to UTF-8
Ctrl + SSave the current file/buffer
Ctrl + WSave the current buffer/file and close the editor
F9Save As...
Ctrl + POpen the preferences dialog-box
Ctrl + GGo to a given line/column
Ctrl + ZUndo
Ctrl + YRedo
Ctrl + FFind
Ctrl + HReplace
Ctrl + KAdd a cursor below
Ctrl + ^Cancel multi-cursor mode

Besides the above, Ctrl + click and mouse-drag will select text, and mouse wheel will move the cursor 2 lines in either direction.

Commands for find and replace operations

These key combinations work when the Find/Replace dialog box is active:

KeyAction
Enter or Ctrl + JFind next match
F7Find previous match
F8Replace the current match
Ctrl + F8Replace all occurrences

Commands for Project Explorer

These key combinations work when the Project Explorer dialog-box is active:

KeyAction
Ctrl + RRefresh file tree
Ctrl + NCreate a new file under the selected directory
Ctrl + DCreate a new directory under the selected directory
F2Rename the selected file/directory
DelMoves the selected file/directory to the trash
+Collapse the current selected directory
-Expand the current selected directory

Other features

ash also provides certain shortcuts for helping in editing code. It has support for auto-indentation when the previous line is indented. Also, pressing any of theese keys: ` ' " ( { [ while some text is selected, will cause ash to enclose the selected text within the pair of matching quotes/brackets.

All of these key bindings can be changed by editing the file ~/.config/ash-editor/keymaps/default.json.