-
-
Notifications
You must be signed in to change notification settings - Fork 119
General editing
Luke edited this page Jul 17, 2024
·
16 revisions
Ox is not modal, and is controlled by various key bindings by default, which are listed in the table below.
You can type straight into the document and use the backspace, return, tab and delete keys to also help modify text.
| Keybinding | What it does |
|---|---|
Ctrl + Q |
Exits the current tab or the editor if only one tab open. |
Ctrl + S |
Saves the open file to the disk. |
Alt + S |
Prompts you for a file name and saves it to disk as that file name. |
Ctrl + A |
Saves all the currently open files to the disk. |
Ctrl + N |
Creates a new tab with a blank document. |
Ctrl + O |
Prompts you for a file and opens that file in a new tab. |
Ctrl + F |
Searches the document for a search query. Allows pressing of ← to move the cursor to the previous occurance fof the query and → to move to the next occurance of the query. Press Return or Esc to leave the search. Note: you can use regular expressions for search queries. |
Ctrl + Z |
Undoes your last action. The changes are committed to the undo stack every time you press the space bar, create / destroy a new line and when there is no activity after a certain period of time which can be used to capture points where you pause for thought or grab a coffee etc... |
Ctrl + Y |
Redoes your last action. The changes are committed to the undo stack every time you press the space bar, create / destroy a new line and when there is no activity after a certain period of time which can be used to capture points where you pause for thought or grab a coffee etc... |
Ctrl + R |
Allows replacing of occurances in the document. Uses the same keybindings as the search feature: ← to move the cursor to the previous occurance of the query and → to move to the next occurance of the query. You can also press Return to carry out the replace action. To exit replace mode once you're finished, you can press Esc. You can also use Space to replace every instance in the document at once. Note: you can use regular expressions for search queries. |
Ctrl + K |
Opens the command line. |
Shift + Left |
Navigates to the previous tab. |
Shift + Right |
Navigates to the next tab. |
Feel free to play around with these command shortcuts to get familiar with them.
This is a neat feature of ox that lets you modify the state of the editor while the editor is open.
To access the command line, use the keyboard shortcut Ctrl + K
You will be greeting with a prompt, where you can type in a command and press enter to run it.
At this prompt, you can use some of the following commands:
-
help- This will toggle a help message to the right hand side to provide a handy reference if you are just starting out. Run this command once to turn it on, and run it again to turn it off. -
readonly [boolean]- This will change the read only status of the document. If you want the document that is currently open to be resistant to modification and saving, then you can run the commandreadonly true, and if you don't, you can runreadonly false. -
filetype [ext]- This will set the filetype of the document. If you have open a file that contains python code, for example, but the editor has not realised it is python code, then you can force it with the commandfiletype py, the parameter to this command is the file type extension, e.g.rsfor rust,luafor lua, etc etc.