To get started, check out the installation instructions so you can follow the tutorial.
Opening a file
Create a new text file and open it with Helix by running hx file.txt. This is what you will see:
1 ~ NOR file.txt 1 sel 1:1 Loaded 1 file.
Notice the NOR in the lower left corner, this indicates that you are currently in Normal mode. In this mode, write letters like my and north will not insert them as text, but will have specific characteristics commands which we will explore later.
To insert text, press Yowhich is the command to enter Insert mode, indicated by the INS in the lower left corner. In this mode, the letters you type will be inserted directly into the document.
Try it by writing Hello helix!.
1 Hello helix! ~ INS file.txt [+] 1 sel 1:13
To return to normal mode press ESC. This will change the color of your cursor and you will see NOR again, indicating that you are now in normal mode.
Motion
To move the cursor, you can use the arrow keys, both in Normal mode and Insert Mode:
- ↑ move the cursor up
- ↓ move the cursor down
- → move the cursor to the right
- ← move the cursor to the left
However, this is not recommended due to the fact that your hand will make a lot of back and forth movements between the arrow keys and the keyboard.
Instead, it is recommended to rest your fingers on the “home row”, which is made up of the row of keys a s d f g h j k l.
Instead of reaching for the arrow keys, use normal mode and h, j, k and I to move the cursor:
- h: Moves the cursor 1 character to the left.
- j: moves the cursor 1 line up.
- k: moves the cursor 1 line down.
- I: moves the cursor 1 character to the right.
Try holding down h and I to move horizontally through the text you just typed.
Paste
We only have one line of text, so duplicate it several times. Guy:
- unknownwhich will select the entire line.
- andwhat will be andank (copy) the selection to the clipboard.
- pwhich will paste the content of the selection after the cursor.
Spam p several times to create multiple lines.
1 Hello helix! 2 Hello helix! 3 Hello helix! 4 Hello helix! 5 Hello helix! ~ NOR file.txt [+] 1 sel 3:8
Now you can try to use the h, j, k and I movements to navigate the text!
Word-based movement
Let’s say we want to replace one of the helix words with world. To do this, place the cursor on one of the h letters:
1 Hello helix! 2 Hello helix! 3 Hello helix! 4 Hello helix! 5 Hello helix! ~ NOR file.txt [+] 1 sel 3:7
my It is a movement that moves towards the myNorth Dakota of the current word. Guy my and will move the cursor to the end of the helix.
However, it doesn’t just move the cursor there. all the helix The word is highlighted:
1 Hello helix! 2 Hello helix! 3 Hello helix! 4 Hello helix! 5 Hello helix! ~ NOR file.txt [+] 1 sel 3:11
If we now press bthat moves towards the bstarting of the current word, will take us back to where we were.
Try this several times, press my and then b to select multiple sections of text. If you want to delete your selection press ;.
Let’s highlight our helix word again:
1 Hello helix! 2 Hello helix! 3 Hello helix! 4 Hello helix! 5 Hello helix! ~ NOR file.txt [+] 1 sel 3:11
Selection First Approach
Helix’s philosophy is that each action will act on a selection.
Every time a text is modified (a action), you will completely anticipate the result, because you will be able to clearly see the highlighted text area and therefore it will be modified.
For example, currently we have the word helix selected. To change it to worldpress do,
1 Hello helix! 2 Hello helix! 3 Hello ! 4 Hello helix! 5 Hello helix! ~ INS file.txt [+] 1 sel 3:7
do removes the content of the current selection and puts us in Insert mode, where you can then type your new word. Exit to Normal mode by pressing esc.
1 Hello helix! 2 Hello helix! 3 Hello world! 4 Hello helix! 5 Hello helix! ~ NOR file.txt [+] 1 sel 3:12
Delete
He d The command deletes the current selection and copies what was deleted to a clipboard.
Let’s try it by doing the following:
-
Select the line we just changed with unknown.
1 Hello helix! 2 Hello helix! 3 Hello world! 4 Hello helix! 5 Hello helix! ~ NOR file.txt [+] 1 sel 3:13
-
d to remove this line.
1 Hello helix! 2 Hello helix! 3 Hello helix! 4 Hello helix! ~ NOR file.txt [+] 1 sel 3:1
-
Spam p several times to create some duplicates.
4 Hello world! 5 Hello world! 6 Hello world! 7 Hello helix! ~ NOR file.txt [+] 1 sel 6:13
Let’s delete all our previous ones. Hello helix! doing the following for each Hello helix! line:
- Select the line with unknown.
- d to delete it.
Now we have something like this:
1 Hello world! 2 Hello world! 3 Hello world! ~ NOR file.txt [+] 1 sel 2:1
Undo and redo
What happens if we make a mistake and want to go back? He you command will youdoing our most recent action. It is similar to Control + z in other editors.
Try to press down you a few times to get to our previous state, before making all those modifications:
3 Hello helix! 4 Hello world! 5 Hello world! 6 Hello helix! ~ NOR file.txt [+] 1 sel 5:13
You is similar to Control + Change + z in other editors. It’s going to undo last undo. It is the inverse of you.
Press You until we return to our most recent state:
1 Hello world! 2 Hello world! 3 Hello world! ~ NOR file.txt [+] 1 sel 1:1 Already at newest change
Control
Feel free to make modifications to your file using the commands we have learned so far:
- h, j, k and I moves 1 character left, down, up and right.
- Yo enters Insert mode.
- esc enters Normal mode.
- unknown select the entire line.
- and pull the selection.
- p pastes the recently copied selection.
- my selects and goes to the end of the current word.
- b selects and goes to the beginning of the current word.
- ; removes the extra selection.
- d deletes the current selection, without exiting Normal mode.
- do changes the current selection, deleting it and entering Insert mode.
- you will undo the most recent change.
- You will undo the most recent undo.
Once you’re happy with your modifications, enter Normal mode and type :.
: enter command modewhich has commands that you type.
:wwillpower write the current file.:qwillpower qsuit the current file.:q!will exit without saving.:wqwill write and resign.
┌──────────────────────────────┐ │ Write changes to disk and │ │ close the current view. │ │ Accepts an optional path │ └──────────────────────────────┘ write-quit-all write-quit-all! :wq
Let’s try more Helix commands! Open the file again with hx file.txt. Select the entire file by pressing %
1 Hello world! 2 Hello world! 3 Hello world! ~ NOR file.txt [+] 1 sel 3:13
Now, delete the selection with d.
~ NOR file.txt [+] 1 sel 1:1
go to word
Wearing b go to the beginning of the word and my Going to the end is useful if you are already at the word you want. But if you are far away, a very powerful command is gramoto worder — gw.
1 aue atates asll 2 ard ape anouds alll 3 aje ahn afll 4 add abe clouds aall 5 acd aee agon aill 6 akd ame aoon aqll NOR file.txt [+] 1 sel 4:13 gw
gw will create two letters at the beginning of each sight word. When you type those two letters, it instantly jumps to the specified word.
Let’s say we want to jump to plates word. The first two characters have been replaced by at and highlighted. if we write atWe will highlight that word!
1 The plates will 2 and the clouds will 3 The sun will 4 and the clouds will 5 and the moon will 6 and the moon will NOR file.txt [+] 1 sel 1:10
Replace
You can also replace a selection with the contents of a record.
- Select the
moonword using gw and throw it with and. - Select the
sunword and replace it withmoonwith R.
Look for
Go to the first line using ggg.
To search for a word, use / domain. Guy will which will highlight the following will keyword, and then Enter ↵ to select it.
Since there are several wills in the text, you can toggle between them:
- north move on to the next game.
- north Go back to the previous game.
More ways to enter Insert mode
Select the clouds word using gw. If you press Yowill enter insert mode at the beginning of the selection. There are also 5 more ways to enter Insert mode:
- to for add enter insert mode at end of selection
- Yo enter insert mode at the beginning of the current line
- TO to add to the end of the current line
- oh add a new line below and enter insert mode
- oh add a new line above and enter insert mode
Try them all!
Records
Helix has a concept called recordswhich is like having many clipboards at once.
To interact with them, prefix the extract and delete commands with a " and then the record name.
For example, the contents of the system clipboard are stored within the + record.
-
Paste the following content into the file with “+p:
-
Navigate to the last line using gee for gramfinal oto.
1 The plates will 2 and the clouds will 3 The sun will 4 and the moon will ~ NOR file.txt [+] 1 sel 4:2
-
Select the last line with unknown and then pull it with and.
1 The plates will 2 and the clouds will 3 The sun will 4 and the moon will ~ NOR file.txt [+] 1 sel 4:18 yanked 1 selection to register "
-
Navigate to the second line using 2gg.
-
Select the second line using unknown and then pull towards the my register with "Hey.
1 The plates will 2 and the clouds will 3 The sun will 4 and the moon will ~ NOR file.txt [+] 1 sel 2:20 yanked 1 selection to register e
-
Navigate to the third line using 3gg.
-
Paste what we copied earlier using p.
1 The plates will 2 and the clouds will 3 The sun will 4 and the moon will 5 and the moon will ~ NOR file.txt [+] 1 sel 4:18
Notice that we have not pasted the content of the second line, but rather the content of the last line? Because we incorporate the content of the second line into my record. To paste it, use “ep.
- " tells the editor that we are going to use a record.
- my use the my record.
- p paste the content of the my record.
1 The plates will 2 and the clouds will 3 The sun will 4 and the moon will 5 and the clouds will 6 and the moon will NOR file.txt [+] 1 sel 5:20
Take note that when we press ppaste the content of the registry after the line. paste beforewe undo with you and use P to paste before.
1 The plates will 2 and the clouds will 3 The sun will 4 and the clouds will 5 and the moon will 6 and the moon will NOR file.txt [+] 1 sel 4:20
Move characters
You can also search for individual characters using twhat does it mean tsick.
-
Copy the text below
Twilight fades; stars—whispering, bold—
"Hope," they hum; yet shadows unfold...
Life? A riddle—endless! Who'll dare,
to seek; to dream: to wander—where?
-
Select the entire file with %
-
Deselect using Space + R.
Go to the first line with ggg and use t; to move to the next semicolon. Repeat this several times.
To move in the opposite direction, use T; to the previous semicolon.
Wearing t and t The movements will move the cursor. just before the next or previous appearance of the character.
For example, tea to move to the next e. “T” to go just before the previous double quote.
He F for FIndiana is similar to tbut instead place the cursor in the appearance of the character. Try to use F; several times. F goes in the opposite direction.
Account
Each motion also accepts an optional option. countwhich defaults to 1 if you don’t provide it.
- For example, use 2f; which would be the same as f;f;.
- EITHER 7b which would be the same as bbbbbbb.
page navigation
Currently the text is quite short, but we can fix that. Select all with %throw and and then paste it 100 times with 100p. This will create a very large file.
We can use these commands to scroll large chunks of text at once:
- Control + d scroll down half a page
- Control + you scroll up half a page
Now that you know the basics of movement in Helix, it’s time to learn about the more advanced features Helix offers.
