Created: December 17, 2023
Modified: December 23, 2024
I've loved using helix. It's the only vim-like editor that just works great out of the box. This page is a list of tips and tricks that were not immediately apparent to me as I first started using it.
g.
- Go to last modification in current file. (This is
great when you're checking something far away and then bouncing
back.)
;
- Un-select current selection
,
- Collapse extra cursors
A-i
- reduce selection to less of the syntax tree
(Remember: "in")
A-o
- expand selection to parent node of the syntax tree
(Remember: "out")
]d
(or [d
) - Move to next (or previous)
diagnostic
gd
- Go to definition
gr
- Go to references
gi
- Go to implementation
<space>k
- Show docs for item under cursor
C-z
suspends your current helix session and drops you
back into the shell. Use the fg
command from the shell to
resume the session exactly where you left it.
I didn't realize until I started using helix that this is the normal way to suspend an active process and give control back to the parent shell.
Helix is unlike vim in that you get a visual selection of your movement as you move in normal mode. This is great until you need to unselect what your movement has selected.
If in the above example, you were to enter insert mode with
i
, you would be moved to the location before your current
selection, which moves the cursor before the word
movement
.
To avoid this, you can collapse your selection to the cursor using
the collapse_selection
command, which is bound to
;
by default.
You may occasionally end up with multiple cursors when performing
actions like searching for a term in select mode. After you're done
editing, the cursors don't go away on their own. Collapse back to a
single cursor with keep_primary_selection
which is bound by
default to ,
.
(Fun fact, coming from vim, I initially rebound ,
to use
it as a leader key for other commands, not realizing I had overridden
something fairly important...)
config.toml
Unlike vim, helix provides built-in commands
:config-open
and :config-reload
for opening
your configuration file and reloading it after it has been changed.