# Key Bindings for ash 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. | Key | Action | |-----|--------| |Ctrl + Q|Close the active window| |Ctrl + @|Forcefully quit the application, discarding all changes| |Tab _or_ Ctrl + I|Switch focus to the next widget in the active dialog-box (if any)| |Shift + Tab|Switch focus to the previous widget in the active dialog-box| |Ctrl + |Move the active dialog-box around the screen| |Space|Check/Uncheck a checkbox in focus| |Enter _or_ Ctrl + W _or_ Ctrl + J|Save changes and close the current dialog box| |Alt + |Open the top-level menu| |Alt + |Close/hide the top-level menu| |Ctrl + L|Show the list of active buffers/files| |Ctrl + T|Show the list of active tabs| |Ctrl + N|Open a new buffer for editing| |Ctrl + O|Open a file| |Ctrl + E|Open project explorer (if directory has been opened)| |F1|Show Help| |F2|Show the list of recently opened files| |F3|Switch to previous editor| |F4|Switch to next editor| |F5|Switch to previous tab| |F6|Switch to next tab| |F11|Toggle fullscreen| |Ctrl + F1|Shows/hides filenames in non-active editors| |Ctrl + F2|Create a new tab| |Ctrl + F3|Split horizontally| |Ctrl + F4|Split vertically| |Ctrl + F5|Merge horizontally| |Ctrl + F6|Merge vertically| |Ctrl + F7|Close the active tab| |Ctrl + F9|Close all editors in the active-tab except the active-editor| |Esc _or_ Ctrl + [|Show the command window| |F12|Search in all open files/buffers| |Ctrl + F12|Search/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. | Key | Action | |-----|--------| |Alt + _or_ Right-Click|Open popup menu| | |Move the cursor in the document one character/line at a time| |Ctrl + |Move the cursor one word at a time| |PgUp PgDown|Move the cursor in the document one screenful at a time| |Home End|Move the cursor to the beginning/end of the current line| |Ctrl + Home End|Move the cursor to the beginning/end of the current document| |Tab|Insert tab OR Increase the indent of the selection| |Shift + Tab|Decrease the indent of the selection if possible| |Shift + Home End|Select text up to the beginning/end of the current line| |Shift + |Select text one character at a time| |Shift + PgUp PgDown|Select one screenful at a time| |Ctrl + A|Select all| |Ctrl + C|Copy| |Ctrl + X|Cut| |Ctrl + V|Paste| |Backspace|Delete the character/selected-text before the cursor| |Del|Delete the selected-text or, character at the cursor position| |Ctrl + F2|Convert all Uncode escape sequences (\uxxxx) to Unicode characters, and also sets file encoding to UTF-8| |Ctrl + S|Save the current file/buffer| |Ctrl + W|Save the current buffer/file and close the editor| |F9|Save As...| |Ctrl + P|Open the preferences dialog-box| |Ctrl + G|Go to a given line/column| |Ctrl + Z|Undo| |Ctrl + Y|Redo| |Ctrl + F|Find| |Ctrl + H|Replace| |Ctrl + K|Add 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: | Key | Action | |-----|--------| |Enter _or_ Ctrl + J|Find next match| |F7|Find previous match| |F8|Replace the current match| |Ctrl + F8|Replace all occurrences| ### Commands for Project Explorer These key combinations work when the Project Explorer dialog-box is active: | Key | Action | |-----|--------| |Ctrl + R|Refresh file tree| |Ctrl + N|Create a new file under the selected directory| |Ctrl + D|Create a new directory under the selected directory| |F2|Rename the selected file/directory| |Del|Moves 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`.