@@ -12,7 +12,7 @@ _________________________________________________________________
12 you might be used to in that it is modal, meaning that it has
12 you might be used to in that it is modal, meaning that it has
13 different modes for editing text. The primary modes you will
13 different modes for editing text. The primary modes you will
14 use are Normal mode and Insert mode. While in Normal mode, the
14 use are Normal mode and Insert mode. While in Normal mode, the
15− keys you press won't actually type text. Instead, they will
15+ keys you type won't actually type text. Instead, they will
16 perform various actions with the text. This allows for more
16 perform various actions with the text. This allows for more
17 efficient editing. This tutor will teach you how you can make
17 efficient editing. This tutor will teach you how you can make
18 use of Helix's modal editing features. To begin, ensure your
18 use of Helix's modal editing features. To begin, ensure your
@@ -21,7 +21,7 @@ _________________________________________________________________
23=================================================================
23=================================================================
24−= BASIC CURSOR MOVEMENT =
24+= 1.1 BASIC CURSOR MOVEMENT =
25=================================================================
25=================================================================
@@ -43,18 +43,18 @@ _________________________________________________________________
45=================================================================
45=================================================================
46−= EXITING HELIX =
46+= 1.2 EXITING HELIX =
47=================================================================
47=================================================================
49− 1. Press the : key to enter command mode. Your cursor will
49+ 1. Type : to enter command mode. Your cursor will
50 move to the bottom of the screen.
50 move to the bottom of the screen.
51− 2. Type q or quit and press <ENTER> to exit Helix.
51+ 2. Type q or quit and type <ENTER> to exit Helix.
53 Note: The quit command will fail if there are unsaved changes.
53 Note: The quit command will fail if there are unsaved changes.
54− To force quit and DISCARD these changes, use q! or quit!.
54+ To force quit and DISCARD these changes, type q! or quit!.
55 You will learn how to save files later.
55 You will learn how to save files later.
57− To exit command mode without entering a command, press <ESC>.
57+ To exit command mode without entering a command, type <ESC>.
59 Now, move on to the next lesson.
59 Now, move on to the next lesson.
@@ -65,13 +65,13 @@ _________________________________________________________________
67=================================================================
67=================================================================
68−= DELETION =
68+= 1.3 DELETION =
69=================================================================
69=================================================================
71− Press the d key to delete the character under the cursor.
71+ Type the d key to delete the character under the cursor.
73 1. Move the cursor to the line below marked -->.
73 1. Move the cursor to the line below marked -->.
74− 2. Move the cursor to each extra character, and press d to
74+ 2. Move the cursor to each extra character, and type d to
75 delete it.
75 delete it.
77 --> Thhiss senttencee haass exxtra charracterss.
77 --> Thhiss senttencee haass exxtra charracterss.
@@ -87,16 +87,16 @@ _________________________________________________________________
89=================================================================
89=================================================================
90−= INSERT MODE =
90+= 1.4 INSERT MODE =
91=================================================================
91=================================================================
93− Press the i key to enter Insert mode.
93+ Type the i key to enter Insert mode.
95 1. Move the cursor to the line below marked -->.
95 1. Move the cursor to the line below marked -->.
96− 2. Move to a place in the line which is missing text and press
96+ 2. Move to a place in the line which is missing text and type
97− i to enter Insert mode. Keys you press will now type text.
97+ i to enter Insert mode. Keys you type will now type text.
98 3. Enter the missing text.
98 3. Enter the missing text.
99− 4. Press <ESC> to exit Insert mode and return to Normal mode.
99+ 4. type <ESC> to exit Insert mode and return to Normal mode.
100 5. Repeat until the line matches the line below it.
100 5. Repeat until the line matches the line below it.
102 --> Th stce misg so.
102 --> Th stce misg so.
@@ -106,13 +106,13 @@ _________________________________________________________________
106 you may use the arrow keys instead of exiting and
106 you may use the arrow keys instead of exiting and
107 reentering Insert mode.
107 reentering Insert mode.
108 Note: The status bar will display your current mode.
108 Note: The status bar will display your current mode.
109− Notice that when you press i, 'NOR' changes to 'INS'.
109+ Notice that when you type i, 'NOR' changes to 'INS'.
111=================================================================
111=================================================================
112−= MORE ON INSERT MODE =
112+= 1.5 MORE ON INSERT MODE =
113=================================================================
113=================================================================
115− As you saw, you can press i to enter Insert mode at the current
115+ As you saw, you can type i to enter Insert mode at the current
116 position of the cursor. There are a few other ways you can
116 position of the cursor. There are a few other ways you can
117 enter Insert mode at different locations.
117 enter Insert mode at different locations.
@@ -123,7 +123,7 @@ _________________________________________________________________
123 A - Insert at the end of the line.
123 A - Insert at the end of the line.
125 1. Move to anywhere in the line below marked -->.
125 1. Move to anywhere in the line below marked -->.
126− 2. Press A (<SHIFT> + a), your cursor will move to the end of
126+ 2. Type A (<SHIFT> + a), your cursor will move to the end of
127 the line and you will be able to type.
127 the line and you will be able to type.
128 3. Type the text necessary to match the line below.
128 3. Type the text necessary to match the line below.
@@ -131,19 +131,19 @@ _________________________________________________________________
131 This sentence is missing some text.
131 This sentence is missing some text.
133=================================================================
133=================================================================
134−= SAVING A FILE =
134+= 1.6 SAVING A FILE =
135=================================================================
135=================================================================
137− Use :w/:write to save a file.
137+ Type :w/:write to save a file.
139 1. Exit Helix using :q! as explained before, or open a new
139 1. Exit Helix using :q! as explained before, or open a new
140 terminal.
140 terminal.
141 2. Open a file in Helix by running: hx FILENAME
141 2. Open a file in Helix by running: hx FILENAME
142 3. Make some edits to the file.
142 3. Make some edits to the file.
143− 4. Press the : key to enter command mode.
143+ 4. Type : to enter command mode.
144− 5. Type w or write, and press <ENTER> to save the file.
144+ 5. Type w or write, and type <ENTER> to save the file.
146− You can also use wq or write-quit to save and exit.
146+ You can also type wq or write-quit to save and exit.
148 Note: You can optionally enter a filepath after the w/write
148 Note: You can optionally enter a filepath after the w/write
149 command in order to save to that path.
149 command in order to save to that path.
@@ -153,21 +153,21 @@ _________________________________________________________________
155=================================================================
155=================================================================
156−= RECAP =
156+= CHAPTER 1 RECAP =
157=================================================================
157=================================================================
159 * Use the h,j,k,l keys to move the cursor.
159 * Use the h,j,k,l keys to move the cursor.
161− * Press : to enter command mode.
161+ * Type : to enter command mode.
162 * The q/quit and q!/quit! commands will exit Helix. The
162 * The q/quit and q!/quit! commands will exit Helix. The
163 former fails when there are unsaved changes. The latter
163 former fails when there are unsaved changes. The latter
164 discards them.
164 discards them.
165 * The w/write command will save the file.
165 * The w/write command will save the file.
166 * The wq/write-quit command will do both.
166 * The wq/write-quit command will do both.
168− * Press d to delete the character at the cursor.
168+ * Type d to delete the character at the cursor.
170− * Press i to enter Insert mode and type text. Press <ESC> to
170+ * Type i to enter Insert mode and type text. Type <ESC> to
171 return to Normal mode.
171 return to Normal mode.
@@ -175,10 +175,10 @@ _________________________________________________________________
177=================================================================
177=================================================================
178−= MOTIONS AND SELECTIONS =
178+= 2.1 MOTIONS AND SELECTIONS =
179=================================================================
179=================================================================
181− Press w to select forward until the next word.
181+ Type w to select forward until the next word.
183 The d key doesn't actually delete the character at the cursor,
183 The d key doesn't actually delete the character at the cursor,
184 it deletes all selected text. Your cursor is like a
184 it deletes all selected text. Your cursor is like a
@@ -186,8 +186,8 @@ _________________________________________________________________
187 1. Move the cursor to the line below marked -->.
187 1. Move the cursor to the line below marked -->.
188 2. Move to the beginning of a word that needs to be deleted.
188 2. Move to the beginning of a word that needs to be deleted.
189− 3. Press w to select until the beginning of the next word.
189+ 3. Type w to select until the beginning of the next word.
190− 4. Press d to delete the selection.
190+ 4. Type d to delete the selection.
191 5. Repeat for all extra words in the line.
191 5. Repeat for all extra words in the line.
193 --> This sentence pencil has vacuum extra words in the it.
193 --> This sentence pencil has vacuum extra words in the it.
@@ -197,10 +197,10 @@ _________________________________________________________________
199=================================================================
199=================================================================
200−= MORE ON MOTIONS =
200+= 2.2 MORE ON MOTIONS =
201=================================================================
201=================================================================
203− As you saw, pressing w moves the cursor forward until the start
203+ As you saw, typing w moves the cursor forward until the start
204 of the next word, selecting the text traversed. This is useful
204 of the next word, selecting the text traversed. This is useful
205 for moving around text and for selecting text to operate on.
205 for moving around text and for selecting text to operate on.
@@ -219,18 +219,18 @@ _________________________________________________________________
221=================================================================
221=================================================================
222−= THE CHANGE COMMAND =
222+= 2.3 THE CHANGE COMMAND =
223=================================================================
223=================================================================
225− Press c to change the current selection.
225+ Type c to change the current selection.
227 The change command deletes the current selection and enters
227 The change command deletes the current selection and enters
228 Insert mode, so it is a very common shorthand for di.
228 Insert mode, so it is a very common shorthand for di.
230 1. Move the cursor to the line below marked -->.
230 1. Move the cursor to the line below marked -->.
231− 2. Move to the start of an incorrect word and press w to
231+ 2. Move to the start of an incorrect word and type w to
232 select it.
232 select it.
233− 3. Press c to delete the word and enter Insert mode.
233+ 3. Type c to delete the word and enter Insert mode.
234 4. Type the correct word.
234 4. Type the correct word.
235 5. Repeat until the line matches the line below it.
235 5. Repeat until the line matches the line below it.
@@ -241,7 +241,7 @@ _________________________________________________________________
243=================================================================
243=================================================================
244−= COUNTS WITH MOTIONS =
244+= 2.4 COUNTS WITH MOTIONS =
245=================================================================
245=================================================================
247 Type a number before a motion to repeat it that many times.
247 Type a number before a motion to repeat it that many times.
@@ -263,15 +263,15 @@ _________________________________________________________________
265=================================================================
265=================================================================
266−= SELECTING LINES =
266+= 2.5 SELECTING LINES =
267=================================================================
267=================================================================
269− Press x to select a whole line. Press again to select the next.
269+ Type x to select a whole line. Type x again to select the next.
271 1. Move the cursor to the second line below marked -->.
271 1. Move the cursor to the second line below marked -->.
272− 2. Press x to select the line, and d to delete it.
272+ 2. Type x to select the line, and d to delete it.
273 3. Move to the fourth line.
273 3. Move to the fourth line.
274− 4. Press x twice or type 2x to select 2 lines, and d to delete.
274+ 4. Type x twice or type 2x to select 2 lines, and d to delete.
276 --> 1) Roses are red,
276 --> 1) Roses are red,
277 --> 2) Mud is fun,
277 --> 2) Mud is fun,
@@ -285,13 +285,13 @@ _________________________________________________________________
287=================================================================
287=================================================================
288−= UNDOING =
288+= 2.6 UNDOING =
289=================================================================
289=================================================================
291 Type u to undo. Type U to redo.
291 Type u to undo. Type U to redo.
293 1. Move the cursor to the line below marked -->.
293 1. Move the cursor to the line below marked -->.
294− 2. Move to the first error, and press d to delete it.
294+ 2. Move to the first error, and type d to delete it.
295 3. Type u to undo your deletion.
295 3. Type u to undo your deletion.
296 4. Fix all the errors on the line.
296 4. Fix all the errors on the line.
297 5. Type u several times to undo your fixes.
297 5. Type u several times to undo your fixes.
@@ -307,7 +307,7 @@ _________________________________________________________________
309=================================================================
309=================================================================
310−= RECAP =
310+= CHAPTER 2 RECAP =
311=================================================================
311=================================================================
313 * Type w to select forward until the next word.
313 * Type w to select forward until the next word.
@@ -329,14 +329,14 @@ _________________________________________________________________
331=================================================================
331=================================================================
332−= MULTIPLE CURSORS =
332+= 3.1 MULTIPLE CURSORS =
333=================================================================
333=================================================================
335 Type C to duplicate the cursor to the next line.
335 Type C to duplicate the cursor to the next line.
337 1. Move the cursor to the first line below marked -->.
337 1. Move the cursor to the first line below marked -->.
338 2. Type C to duplicate the cursor to the next line. Keys you
338 2. Type C to duplicate the cursor to the next line. Keys you
339− press will now affect both cursors.
339+ type will now affect both cursors.
340 3. Use Insert mode to correct the lines. The two cursors will
340 3. Use Insert mode to correct the lines. The two cursors will
341 fix both lines simultaneously.
341 fix both lines simultaneously.
342 4. Type , to remove the second cursor.
342 4. Type , to remove the second cursor.
@@ -346,22 +346,22 @@ _________________________________________________________________
347 Fix these two lines at the same time.
347 Fix these two lines at the same time.
349−
349+ Note: Type alt-C to do the same above the cursor.
353=================================================================
353=================================================================
354−= THE SELECT COMMAND =
354+= 3.2 THE SELECT COMMAND =
355=================================================================
355=================================================================
357 Type s to select matches in the selection.
357 Type s to select matches in the selection.
359 1. Move the cursor to the line below marked -->.
359 1. Move the cursor to the line below marked -->.
360− 2. Press x to select the line.
360+ 2. Type x to select the line.
361− 3. Press s. A prompt will appear.
361+ 3. Type s. A prompt will appear.
362− 4. Type 'apples' and press <ENTER>. Both occurrences of
362+ 4. Type 'apples' and type <ENTER>. Both occurrences of
363 'apples' in the line will be selected.
363 'apples' in the line will be selected.
364− 5. You can now press c and change 'apples' to something else,
364+ 5. You can now type c and change 'apples' to something else,
365 like 'oranges'.
365 like 'oranges'.
366 6. Type , to remove the second cursor.
366 6. Type , to remove the second cursor.
@@ -373,16 +373,16 @@ _________________________________________________________________
375=================================================================
375=================================================================
376−= SELECTING VIA REGEX =
376+= 3.3 SELECTING VIA REGEX =
377=================================================================
377=================================================================
379 The select command selects regular expressions, not just exact
379 The select command selects regular expressions, not just exact
380 matches, allowing you to target more complex patterns.
380 matches, allowing you to target more complex patterns.
382 1. Move the cursor to the line below marked -->.
382 1. Move the cursor to the line below marked -->.
383− 2. Select the line with x and then press s.
383+ 2. Select the line with x and then type s.
384 3. Enter ' +' to select any amount of consecutive spaces >1.
384 3. Enter ' +' to select any amount of consecutive spaces >1.
385− 4. Press c and change the matches to single spaces.
385+ 4. Type c and change the matches to single spaces.
387 --> This sentence has some extra spaces.
387 --> This sentence has some extra spaces.
@@ -395,7 +395,7 @@ _________________________________________________________________
397=================================================================
397=================================================================
398−= COLLAPSING SELECTIONS =
398+= 3.4 COLLAPSING SELECTIONS =
399=================================================================
399=================================================================
401 Type ; to collapse selections to single cursors.
401 Type ; to collapse selections to single cursors.
@@ -404,7 +404,6 @@ _________________________________________________________________
404 cursor(s). This can be done using the ; key.
404 cursor(s). This can be done using the ; key.
406 1. Move the cursor to the line below marked -->.
406 1. Move the cursor to the line below marked -->.
408 2. Use the motions you have learned to move around the line,
407 2. Use the motions you have learned to move around the line,
409 and try using ; to deselect the text after it is selected
408 and try using ; to deselect the text after it is selected
410 by the motions.
409 by the motions.
@@ -416,6 +415,296 @@ _________________________________________________________________
419+=================================================================
420+= 3.5 SELECTING TO A CHARACTER =
421+=================================================================
423+ Type f<ch> to select up to and including (find) a character.
424+ Type t<ch> to do the same, but not including (till) a character.
425+ Type uppercase F/T to do the same backwards.
427+ 1. Move the cursor to the line below marked -->. Place the
428+ cursor on the first dash.
429+ 2. Type f[ to select to the square bracket.
430+ 3. Type d to delete your selection.
431+ 4. Go to the end of the line and repeat with F].
432+ 5. Move to the second line marked -->, just after the arrow.
433+ 6. Use t and T to delete the dashes around the sentence.
435+ --> -----[Free this sentence of its brackets!]-----
436+ --> ------Free this sentence of its dashes!------
438+ Note: Unlike Vim, Helix doesn't limit these commands to the
439+ current line. It searches for the character in the file.
441+=================================================================
443+=================================================================
445+ * Type C to copy the selection on the line below and Alt-C for
448+ * Type s to select all instances of a regex pattern inside
449+ the current selection.
451+ * Type semicolon ( ; ) to collapse selection.
453+ * Type f / F to extend selection up to & including a character.
455+ * Type t / T to extend selection until a character.
463+=================================================================
464+= 4.1 COPYING AND PASTING TEXT =
465+=================================================================
467+ Type y to yank (copy) the selection.
468+ Type p to paste the yanked selection after the cursor.
469+ Type P to paste the yanked text before the cursor.
471+ 1. Move the cursor to the line below marked -->.
472+ Make sure your cursor is on the "b" of banana.
473+ 2. Type w to select "banana" and y to yank it.
474+ 3. Move to the space between "2" and "3" and type p to paste.
475+ 4. Repeat between "3" and "4".
478+ 1 banana 2 banana 3 banana 4
480+ Note: Whenever you delete or change text, Helix will copy the
481+ altered text. Use alt-d/c instead to avoid this.
482+ Note: Helix doesn't share the system clipboard by default. Type
483+ space-y/p to yank/paste on your computer's main clipboard.
485+=================================================================
486+= 4.2 CHANGING CASE =
487+=================================================================
489+ Type ~ to switch the case of all selected letters.
490+ Type ` to set all selected letters to lowercase.
491+ Type Alt-` to set all selected letters to uppercase.
493+ 1. Move the cursor to the first line below marked -->.
494+ 2. Select each wrongly capitalised or lowercase letter
495+ and type ~ over them.
496+ 3. Move to the second line marked -->.
497+ 4. Type x to select the line.
498+ 5. Type ` to change the line to lowercase.
499+ 6. Move to the third line marked -->.
500+ 7. Type x to select the line.
501+ 8. Type Alt-` to change the line to uppercase.
503+ --> thIs sENtencE hAs MIS-cApitalIsed leTTerS.
504+ --> this SENTENCE SHOULD all be in LOWERCASE.
505+ --> THIS sentence should ALL BE IN uppercase!
507+=================================================================
509+=================================================================
511+ Macros are a way to record a set of actions you want to repeat.
513+ Type Q to start recording a macro, you should see a popup at
514+ the bottom of your screen. Type Q again to stop recording.
515+ Type q to repeat your recorded macro.
517+ 1. Move the cursor to the first line below marked -->.
518+ Ensure your cursor is on the > of the arrow.
519+ 2. Type Q to start recording.
520+ 3. Edit the line to look like the bottom one.
521+ 4. Exit insert and Type Q again to stop recording.
522+ 5. Move to the line below and put your cursor on the > again.
523+ 6. Type q to repeat the macro.
525+ --> ... sentence doesn't have it's first and last ... .
526+ --> ... sentence doesn't have it's first and last ... .
527+ This sentence doesn't have it's first and last word.
529+=================================================================
531+=================================================================
533+ * Type y to yank (copy) text and p to paste.
534+ * Type space-Y and space-P to yank/paste on the system
537+ * Type ~ to alternate case of selected letters.
538+ * Use ` and alt-` to set the case of selected layers to
539+ upper and lower respectively.
541+ * Type Q to record and stop recording a macro.
542+ * Type q to repeat the recorded macro.
551+=================================================================
552+= 5.1 USING THE JUMPLIST =
553+=================================================================
555+ Helix can keep track of "jumps" which are big movements, like
556+ jumping to the definition of a function in code. It stores
557+ these in what's called the jumplist.
559+ Type C-s (ctrl-s) to manually save your current position to
562+ Type C-i and C-o to move forward and backwards in the jumplist
565+ 1. Type C-s somewhere.
566+ 2. Move far away in the file.
567+ 3. Type C-o (just once!) to come back to where you saved.
573+=================================================================
574+= 5.2 SEARCHING IN FILE =
575+=================================================================
577+ Type / to search forward in file, enter to confirm search.
578+ Type n to go to the next search match.
579+ Type N to go to the previous search match.
581+ 1. Type / and type in a common word, like 'banana'.
582+ 2. Type enter to confirm the search.
583+ 3. Use n and N to cycle through the matches.
585+ Like the select command, searching also uses regex.
587+ Note: To search backwards, type ? (shift-/).
589+ Note: Unlike Vim, N doesn't change the search direction.
590+ N always goes backwards and n always goes forwards.
595+=================================================================
597+=================================================================
599+ * Type C-s to save position to the jumplist.
600+ * Type C-i and C-o to go forward and backward in the jumplist.
602+ * Type / to search forward in file, and ? to search backwards.
603+ * Use n and N to cycle through search matches.
617+=================================================================
618+= 6.1 JOINING LINES =
619+=================================================================
621+ Type J to join together lines in selection.
623+ 1. Move the cursor to the line below marked -->.
624+ 2. Type J thrice or 3J to join the sentence to one line.
626+ --> This line sentence
631+ Note: J works on all lines in selection, so typing xxx or 3x to
632+ select the lines and then a single J will work the same.
639+=================================================================
640+= 6.2 INDENTING LINES =
641+=================================================================
643+ Type > to indent a line and < to outdent it.
645+ 1. Move the cursor to the line below marked -->.
646+ 2. Move down to the second line and type > to indent it.
647+ 3. Move to the third line and type < to unindent it.
661+=================================================================
662+= 6.3 OPENING LINES =
663+=================================================================
665+ Type o to add a newline and insert below the cursor.
666+ Type O to add a newline and insert above the cursor.
668+ 1. Move the cursor to the line below marked -->.
669+ 2. Type o to open a line below and type your answer.
671+ --> What is the best editor?
683+=================================================================
685+=================================================================
687+ * Type J to join lines within selection.
689+ * Type > and < to indent and outdent selected lines.
691+ * Use o and O to open lines.
419=================================================================
705=================================================================
420 This tutorial is still a work-in-progress.
706 This tutorial is still a work-in-progress.
421 More sections are planned.
707 More sections are planned.