Helix Editor: a cheat sheet
About
Helix Editor is a terinal-based text editor writen in Rust.
The main article
https://docs.helix-editor.com/keymap.html
General notes
Commands need to be typed in Normal Mode. To enterthe Normal Mode, press ESC
Key bindings
Buffers
Buffers store contents of files. When you open a new file, the buffer with previous file goes to background. But you can open the previous buffer again.
Select buffer
- Press
space
- Press
b
Here you can pick a previously opened file.
Files
Open a file
- Press
space
- Press
f
This will open file picker where you can select a file to open
Navigation
General
Go to next word start | w |
Go to next WORD start | W |
Go to previous word start | b |
Go to previous WORD start | B |
Go to next word end | e |
Go to next WORD end | E |
Go to the first line | gg |
Go to the last line | ge |
Go to line with provided number
- Press
g
- Type the line number
- Press
g
Selection
Select current line: x
Select the whold document: %
Copy, paste
Copy (yank) to system clipboard
- Press
v
- Select your text using arrows or mouse pointer (if supported)
- Press
SPACE
- Press
y
- Paste your text wherever your wish
Search and replace
Unlike in some other editors, the Search and Replace operation in Helix is a chain of commands:
- Press
%s
(do NOT add:
before) - Type your search term and press
ENTER
- Press
c
- Now you have multiselect active with original values deleted. You can type the value to replace your original values with whatever you will type
- Press
ENTER
- Press
,
to exit from multiselect mode
Line operations
Delete a line
- Press
x
to select the current line - Press
d
Splits
You can split the editor window horizontally and vertically
Open a document in new split
Horizontal: %hsplit FILENAME
. The editor will suggest you file names from current directory
Vertical: %vsplit FILENAME
Close a split
- Press
<ctrl>
+w
- Press
q
Navigation between splits
- Press
<ctrl>
+w
- Press an arrow key you want to navigate to. Alternatively, you can use Vi key bindings (
h
- left,l
- right,j
- down,k
- up)