Helix

Updated: 18 December 2024

This is basically a summary of the helix --tutor

Introduction

Helix uses HJKL for basic movement. :w is used to save, :q is used to quit. When doing these shortcuts helix will also show the command menu with some relevant docs or autocompletions

Something that differentiates Helix from Vim is that Helix is is based on the subject-verb pattern versus Vim that uses the verb-subject pattern for commands

Basic Motions

Most motions act on a selection

KeybindingDescription
%Select the entire file
&Align multi-cursor selection
.Repeat current line
/Search
:qQuit
:wWrite file
:wqWrite and save
;Collapse selections
<alt>;Reverse selections
<alt>cAdd cursor above current
<alt>sSplit selection lines into cursors
<space>pPaste from system clipboard
<space>yYank into system clipboard
CAdd cursor below current
JJoin lines together
NPrevious search result
URedo
b or BMove to beginning of current word or WORD
cChange current selection
dDelete the current character or selection
e or EMove to end of current word or WORD
f<char>Find character
iEnter insert mode, insert in front of cursor
nNext search result
pPaste selection
r<ch>Replace all selections with character
sSelect matches in selection
s + regexSelect using a regex
t<char>Select till character
uUndo
vToggle select mode
w or WMove to beginning of next word or WORD
xSelect a line
yYank (copy) selection
> or <Indent or dedent line
<ctrl>a or <ctrl>dIncrement or decrement number
RReplace selection with yanked text
"<char>Select a register
QStart or stop recording macro
qPlay macro
* (short for "/y)Put selection into search register (/)
<ctrl>sSave current location to jumplist
<ctrl>oMove forwards in jump list
<ctrl>iGo backwards in jump list
( or )Cycle primary selection back or forwards
<alt>,Remove primary selection from multi select
<alt>) or <alt>(Cycle the content of selections
~Switch case of all selected letters
<backtick>Set all selected letters to lowercase
<alt><backtick>Set all selected characters to uppercase
SSplit selection on a regex
<ctrl>cToggle line comment
mim or mi<delimiter>Select inside object or delimiter pair
mam or ma<delimiter>Select around object or delimiter pair
mdm or md<delimiter>Delete surrounding delimiter pair
ms<delimiter>Add surrounding delimiter pair

Repeating Motions

Motions can be repeated using a number followed by a motion, e.g 2w moves 2 words forward

Match Mode

Match model lets you select content around something such as brackets or other objects. This works by typing m in normal mode, from there you can follow the menus to select more specifically

Stopped on ch 13 of hx --tutor