helix_tutor
helix_tutor
###x. .|
d#####x, ,v||
'+#####v||||||
,v|||||+'. _ _ _
,v|||||^'>#### | | | | ___ | | (_) __ __
|||||^' .v#### | |___| | / \ | | _ \ \/ /
||||=..v#####P' | ___ | / ^ | | | | | \ /
''v'>#####P' | | | | | --- | | | | / \
,######/P||x. |_| |_| \___/ |_| |_| /_/\_\
####P' "x|||||,
|/' 'x||| A post-modern modal text editor.
' '|
=================================================================
= INTRODUCTION =
=================================================================
=================================================================
= 1.1 BASIC CURSOR MOVEMENT =
=================================================================
↑
k * h is on the left
← h l → * l is on the right
j * j looks like a down arrow
↓
Note: The quit command will fail if there are unsaved changes.
To force quit and DISCARD these changes, type q! or quit!.
You will learn how to save files later.
=================================================================
= 1.3 DELETION =
=================================================================
=================================================================
= 1.4 INSERT MODE =
=================================================================
=================================================================
= 1.5 SAVING A FILE =
=================================================================
Note: You can optionally enter a file path after the w / write
command in order to save to that path.
Note: If there are any unsaved changes to a file, a plus [+]
will appear next to the file name in the status bar.
=================================================================
= CHAPTER 1 RECAP =
=================================================================
=================================================================
= 2.1 MORE INSERT COMMANDS =
=================================================================
As you saw, you can type i to enter Insert mode at the current
position of the cursor. There are a few other ways you can
enter Insert mode at different locations.
=================================================================
= 2.2 OPENING LINES =
=================================================================
=================================================================
= CHAPTER 2 RECAP =
=================================================================
* Use o and O to open lines below and above the cursor respectively.
=================================================================
= 3.1 MOTIONS AND SELECTIONS =
=================================================================
--> This sentence pencil has vacuum extra words in the it.
This sentence has extra words in it.
=================================================================
= 3.2 MORE MOTIONS =
=================================================================
As you saw, typing w moves the cursor forward until the start
of the next word, selecting the text traversed. This is useful
for moving around text and for selecting text to operate on.
=================================================================
= 3.3 WORDS AND words =
=================================================================
=================================================================
= 3.4 THE CHANGE COMMAND =
=================================================================
=================================================================
= 3.5 COUNTS WITH MOTIONS =
=================================================================
--> This is just a line with words you can move around in.
=================================================================
= 3.6 SELECT / EXTEND MODE =
=================================================================
--> Remove the FOO BAR distracting words BAZ BIZ from this line.
=================================================================
= 3.7 SELECTING LINES =
=================================================================
=================================================================
= 3.8 COLLAPSING SELECTIONS =
=================================================================
=================================================================
= CHAPTER 3 RECAP =
=================================================================
=================================================================
= 4.1 UNDOING =
=================================================================
--> Fiix the errors on thhis line and reeplace them witth undo.
=================================================================
= 4.2 COPYING AND PASTING TEXT =
=================================================================
--> 1 banana 2 3 4
1 banana 2 banana 3 banana 4
Note: Whenever you delete or change text, Helix will copy the
altered text. Use Alt-d / Alt-c instead to avoid this.
Note: Helix doesn't share the system clipboard by default. Type
Space + y / p to yank / paste on the system's clipboard.
=================================================================
= 4.3 SEARCHING IN FILE =
=================================================================
=================================================================
= CHAPTER 4 RECAP =
=================================================================
=================================================================
= 5.1 MULTIPLE CURSORS =
=================================================================
Type C to duplicate the cursor to the next suitable line.
1. Move the cursor to the first line marked '-->' below. Place
the cursor somewhere past the '-->'.
2. Type C to duplicate the cursor to the next suitable line.
Notice how it skips the line in the middle. Keys you type
will now affect both cursors.
3. Use Insert mode to correct the lines. The two cursors will
fix both lines simultaneously.
4. Type , to remove the first cursor.
=================================================================
= 5.2 THE SELECT COMMAND =
=================================================================
=================================================================
= 5.3 SELECTING VIA REGEX =
=================================================================
=================================================================
= 5.4 ALIGN SELECTIONS =
=================================================================
1. Move the cursor to the first line marked '-->' below. Place
the cursor on the whitespace just after the arrow.
2. Type C four times or 4C.
3. Type W to select the numbers and brackets.
4. Type & to align the words.
Note: & only cares about the alignment of the "head" of the
selections - the end that moves. The other end is called
the "anchor".
=================================================================
= 5.5 SPLIT SELECTION INTO LINES =
=================================================================
| FRUIT | AMOUNT |
|---------|--------|
| Apples | 8 |
| Bananas | 6 |
| Oranges | 3 |
| Donuts | 4 |
=================================================================
= CHAPTER 5 RECAP =
=================================================================
=================================================================
= 6.1 SELECTING TO A CHARACTER =
=================================================================
1. Move the cursor to the line marked '-->' below. Place the
cursor on the first dash.
2. Type f[ to select to the square bracket.
3. Type d to delete your selection.
4. Go to the end of the line and repeat with F].
5. Move to the second line marked '-->', just after the arrow.
6. Use t and T to delete the dashes around the sentence.
=================================================================
= 6.2 THE REPLACE COMMAND =
=================================================================
1. Move to the second line of the table, place the cursor on the
first =.
2. Type t| (Shift-\) to select the = separator.
3. Type r- to replace the separator with dashes.
| Month | Days |
|=======|------|
| Jan | 31 |
| Feb | 28 |
| Mar | 31 |
| ... | ... |
=================================================================
= 6.3 REPETITION =
=================================================================
Type . to repeat the last insert command.
Press Alt-. to repeat the last f / t selection.
--> This is some text for you to repeat things. You can repeat
insertions like changing words, or repeat selections like
f / t.
=================================================================
= CHAPTER 6 RECAP =
=================================================================
=================================================================
= 7.1 REPLACE WITH YANKED TEXT =
=================================================================
=================================================================
= 7.3 INDENTING LINES =
=================================================================
These lines
are indented
much better.
=================================================================
= 7.4 INCREMENTING AND DECREMENTING =
=================================================================
=================================================================
= CHAPTER 7 RECAP =
=================================================================
=================================================================
= 8.1 REGISTERS =
=================================================================
=================================================================
= 8.2 MACROS =
=================================================================
--> ... sentence doesn't have its first and last ... .
--> ... sentence doesn't have its first and last ... .
This sentence doesn't have its first and last word.
=================================================================
= CHAPTER 8 RECAP =
=================================================================
=================================================================
= 9.1 SEARCHING FOR SELECTIONS =
=================================================================
=================================================================
= 9.2 ADDING SELECTION ON NEXT SEARCH MATCH =
=================================================================
=================================================================
= 9.3 USING THE JUMPLIST =
=================================================================
Helix can keep track of "jumps" which are big movements, like
searching or jumping to the definition of a function in code. It
stores these in what's called the jumplist.
=================================================================
= CHAPTER 9 RECAP =
=================================================================
=================================================================
= 10.2 CYCLING THE CONTENT OF SELECTIONS =
=================================================================
=================================================================
= 10.3 CHANGING CASE =
=================================================================
=================================================================
= 10.4 SPLITTING SELECTIONS =
=================================================================
---
these are sentences. some sentences don't start with uppercase
letters! that is not good grammar. you can fix this.
=================================================================
= CHAPTER 10 RECAP =
=================================================================
=================================================================
= 11.2 COMMENTING MULTIPLE LINES =
=================================================================
=================================================================
= CHAPTER 11 RECAP =
=================================================================
=================================================================
= 12.2 USING MATCH MODE SELECT INSIDE =
=================================================================
Match mode also lets you select the "inside" content between a
pair of brackets or other delimiters. In the lines below:
- move to the --> line, put your cursor in normal mode at any
location between the parenthesis, for example at 'x', and press
mi( or mi) to select the whole content inside the parenthesis
(parenthesis excluded). As usual, you can then do anything you want
with the selection (for example, press c to change it)
Test below that you can do the same with [], or {}, or with
nested combinations of these (this will act on the immediately
surrounding matching pair). This also works with "" and similar
=================================================================
= 12.3 USING MATCH MODE SELECT AROUND =
=================================================================
You can also select the "around" content, i.e. both the inside
content and the delimiters themselves, by using the ma select.
For example, move to the line under, move your cursor in normal
mode to any position between the (), and select the content of
the (), including the surrounding (), by typing ma( or ma). As
usual, you can do anything you want with the selection, for
example delete it all with ma(d .
=================================================================
= 12.4 USING MATCH MODE SURROUND =
=================================================================
The match mode can also be used to add surrounding around the
current selection. For example, move to the line below, then:
* i) select the "select all of this" line segment (for example,
move in normal mode the cursor to the start of select, then enter
selection mode with v , then select the 4 next words with 4e ),
* ii) press ms( or ms) to surround the selection with a pair of
parenthesis.
You can do the same with other delimiters: for example, ms' on
WORD below to surround it with a pair of ''. You can try also
with adding a surrounding pair of "", or {}, or [].
=================================================================
= 12.5 USING MATCH MODE DELETE SURROUND =
=================================================================
You can try to replace a non existing pair: this will show
an error warning at the bottom bar and do nothing.
=================================================================
= CHAPTER 12 RECAP =
=================================================================
You can enter the match mode with the m key; this will show the
actions available in a popup. This will allow you to:
* jump to matching pair of delimiters with mm (you must have a
delimiter belonging to a pair under your cursor)
* select inside a pair of delimiters surrounding your cursor
(i.e. select the content but not the delimiters) with mi(
and similar
* select around a pair of delimiters surrounding your cursor
(i.e. select the content and the delimiters) with ma( and
similar
* delete surrounding delimiters with md( and similar
* add surrounding delimiters around the selection with ms(
* replace a pair of delimiters surrounding your selection with
mr([ to replace for example surrounding () with []
=================================================================
= CHAPTER 13.1 CREATE NEW SPLIT =
=================================================================
In Normal mode, press Ctrl-w to open the Window menu, which displays
a list of available commands.
=================================================================
= CHAPTER 13.2 MOVE BETWEEN SPLITS =
=================================================================
Use Ctrl-w k to move to the split above your current split. Use
Ctrl-w j to move to the split below. Use Ctrl-w h to move to
the split on the left and Ctrl-w l to move to the split on the
right. To navigate to the next split (in the order they were
opened), press Ctrl-w w.
You can now do whatever you want in your new buffers and splits.
Once you are done with using your new buffer split,
you can close it with Ctrl-w q . Move to the bottom right split
with Ctrl-w l then Ctrl-w j, then press Ctrl-w q to close this
specific split.
You can also close all splits except the current one with Ctrl-w o .
Open a third vertical split with Ctrl-w nv , then move to the
leftmost split with Ctrl-w h twice, then from inside the split on
the left press Ctrl-w o to close all except this split.
=================================================================
= CHAPTER 13.3 SPLIT CURRENT BUFFER =
=================================================================
=================================================================
= CHAPTER 13.4 USE COMMANDS TO SPLIT =
=================================================================
The :vsplit (or :vs for short) and :hsplit (or :hs) commands can
also be used to split a specific buffer vertically or horizontally.
For example, enter the command:
:vs something
:hs some_more
=================================================================
= CHAPTER 13.5 SWAPPING SPLITS =
=================================================================
Open a split on the left with :vs hello1 and then a split below
with :hs hello2.
From hello2, press Ctrl-w K to swap it with the split above. Now
hello2 is at the top while hello1 is at the bottom.
Still from hello2, press Ctrl-w H to swap with the split on the
left: now hello2 is on the left and the tutor is on the top
right. After Ctrl-w you can use HJKL to split with the buffer
on the left / below / above / on the right.
Move back to the tutor split, and press Ctrl-w o to only keep
this split.
=================================================================
= CHAPTER 13.6 TRANSPOSE SPLITS =
=================================================================
Open a split on the left with :vs hello1 and then a split below
with :vs hello2.
Move back to the tutor split and press Ctrl-w o to close all but
the tutor window.
=================================================================
= CHAPTER 13.7 OPEN SPLIT FROM FILEPICKER =
=================================================================
Splits can also be opened directly from the file picker. Press
space f to open the file picker. From there, you can type in text
to perform file lookup with fuzzy matching, and use the arrows
up and down to move the selected file (indicated by the > symbol).
If you want to exit the file picker, press Escape.
Select any file you like in the file picker. You could open it in
the current view by pressing enter (do not do this at present).
But you can also open it in a new split. Press Ctrl-v to open
the selected file in a new vertical split. Press space f again,
select any file you want, and press Ctrl-s to open it in a
horizontal split.
Move back to the tutor split, and press Ctrl-w o to close all
splits except this one.
=================================================================
= CHAPTER 13 RECAP =
=================================================================
Splits can be used to display either the same buffer several times
or several buffers. To access the main windows and splits commands,
press Ctrl-w . You can move between splits with Ctrl-w hjkl ,
you can close a split with Ctrl-w q , and you can close all but
the present split with Ctrl-w o .
Splits can also be used directly from the file pickers, by using
Ctrl-v to open the file selected in a new vertical split, and
Ctrl-s in a horizontal split.
=================================================================
This tutorial is still a work-in-progress.
More sections are planned.