3 | |_| | ___ | | (_) \ \/ /
5 | | | | | __/ | | | | / /\ \
6 |_| |_| \___| |_| |_| /_/ \_\
8 A post-modern modal text editor.
9_________________________________________________________________
11 Welcome to the Helix editor! Helix is different from editors
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
14 use are Normal mode and Insert mode. While in Normal mode, the
15 keys you type won't actually type text. Instead, they will
16 perform various actions with the text. This allows for more
17 efficient editing. This tutor will teach you how you can make
18 use of Helix's modal editing features. To begin, ensure your
19 CapsLock key is not pressed and hold the j key until you reach
23=================================================================
24= 1.1 BASIC CURSOR MOVEMENT =
25=================================================================
29 ← h l → * l is on the right
30 j * j looks like a down arrow
33 The cursor can be moved using the h, j, k, l keys, as shown
34 above. The cursor / arrow keys will also work, but it is faster
35 to use the hjkl keys as they are closer to the other keys you
36 will be using. Try moving around to get a feel for hjkl.
37 Once you're ready, hold j to continue to the next lesson.
45=================================================================
47=================================================================
49 1. Type : to enter Command mode. Your cursor will
50 move to the bottom of the screen.
51 2. Type q or quit and type Enter to exit Helix.
53 Note: The quit command will fail if there are unsaved changes.
54 To force quit and DISCARD these changes, type q! or quit!.
55 You will learn how to save files later.
57 To exit Command mode without entering a command, type Escape.
59 Now, move on to the next lesson.
67=================================================================
69=================================================================
71 Type the d key to delete the character under the cursor.
73 1. Move the cursor to the line marked '-->' below.
74 2. Move the cursor to each extra character, and type d to
77 --> Thhiss senttencee haass exxtra charracterss.
78 This sentence has extra characters.
80 Once the sentence is correct, move on to the next lesson.
89=================================================================
91=================================================================
93 Type the i key to enter Insert mode.
95 1. Move the cursor to the line marked '-->' below.
96 2. Move to a place in the line which is missing text and type
97 i to enter Insert mode. Keys you type will now type text.
98 3. Enter the missing text.
99 4. type Escape to exit Insert mode and return to Normal mode.
100 5. Repeat until the line matches the line below it.
103 This sentence is missing some text.
105 Note: The status bar will display your current mode.
106 Notice that when you type i, 'NOR' changes to 'INS'.
111=================================================================
113=================================================================
115 Type :w / :write to save a file.
117 1. Exit Helix using :q! as explained before, or open a new
119 2. Open a file in Helix by running: hx FILENAME
120 3. Make some edits to the file.
121 4. Type : to enter Command mode.
122 5. Type w or write, and type Enter to save the file.
124 You can also type wq or write-quit to save and exit.
126 Note: You can optionally enter a filepath after the w / write
127 command in order to save to that path.
128 Note: If there are any unsaved changes to a file, a plus [+]
129 will appear next to the file name in the status bar.
133=================================================================
135=================================================================
137 * Use the h,j,k,l keys to move the cursor.
139 * Type : to enter Command mode.
140 * The q / quit and q! / quit! commands will exit Helix. The
141 former fails when there are unsaved changes. The latter
143 * The w / write command will save the file.
144 * The wq / write-quit command will do both.
146 * Type d to delete the character at the cursor.
148 * Type i to enter Insert mode and type text. Type Escape to
149 return to Normal mode.
155=================================================================
156= 2.1 MORE INSERT COMMANDS =
157=================================================================
159 As you saw, you can type i to enter Insert mode at the current
160 position of the cursor. There are a few other ways you can
161 enter Insert mode at different locations.
163 Common examples of insertion commands include:
164 i - Insert before the selection.
165 a - Insert after the selection. (a means 'append')
166 I - Insert at the start of the line.
167 A - Insert at the end of the line.
169 1. Move to anywhere in the line marked '-->' below.
170 2. Type A (Shift-a), your cursor will move to the end of
171 the line and you will be able to type.
172 3. Type the text necessary to match the line below.
174 --> This sentence is miss
175 This sentence is missing some text.
177=================================================================
179=================================================================
181 Type o to add a newline and insert below the cursor.
182 Type O to add a newline and insert above the cursor.
184 1. Move the cursor to the line marked '-->' below.
185 2. Type o to open a line below and type your answer.
187 --> What is the best editor?
199=================================================================
201=================================================================
203 * Type a to append to the selection.
205 * Type I to enter Insert mode at the first non-whitespace
206 character at the start of a line.
208 * Type A to enter Insert mode at the end of a line.
210 * Use o and O to open lines below and above the cursor respectively.
221=================================================================
222= 3.1 MOTIONS AND SELECTIONS =
223=================================================================
225 Type w to select forward until the next word.
227 The d key doesn't actually delete the character at the cursor,
228 it deletes all selected text. Your cursor is like a
229 single-character selection.
231 1. Move the cursor to the line marked '-->' below.
232 2. Move to the beginning of a word that needs to be deleted.
233 3. Type w to select until the beginning of the next word.
234 4. Type d to delete the selection.
235 5. Repeat for all extra words in the line.
237 --> This sentence pencil has vacuum extra words in the it.
238 This sentence has extra words in it.
243=================================================================
244= 3.2 MORE ON MOTIONS =
245=================================================================
247 As you saw, typing w moves the cursor forward until the start
248 of the next word, selecting the text traversed. This is useful
249 for moving around text and for selecting text to operate on.
251 Some common motions include:
252 w - Move forward to before the beginning of the next word.
253 e - Move forward to the end of the current word.
254 b - Move backward to the beginning of the current word.
256 The w,e,b motions also have counterparts - W,E,B - which
257 traverse WORDS instead of words. WORDS are only separated by
258 whitespace, whereas words can be separated by other characters
259 in addition to whitespace.
261 All of these motions select the text they traverse.
265=================================================================
266= 3.3 THE CHANGE COMMAND =
267=================================================================
269 Type c to change the current selection.
271 The change command deletes the current selection and enters
272 Insert mode, so it is a very common shorthand for di.
274 1. Move the cursor to the line marked '-->' below.
275 2. Move to the start of an incorrect word and type w to
277 3. Type c to delete the word and enter Insert mode.
278 4. Type the correct word.
279 5. Repeat until the line matches the line below it.
281 --> This paper has heavy words behind it.
282 This sentence has incorrect words in it.
287=================================================================
288= 3.4 COUNTS WITH MOTIONS =
289=================================================================
291 Type a number before a motion to repeat it that many times.
293 1. Move the cursor to the line marked '-->' below.
294 2. Type 2w to move 2 words forward.
295 3. Type 3e to move to the end of the third word forward.
296 4. Type 2b to move 2 words backwards
297 5. Try the above with different numbers.
299 --> This is just a line with words you can move around in.
309=================================================================
310= 3.5 SELECT / EXTEND MODE =
311=================================================================
313 Type v to enter Select mode.
314 Type v again or Escape to return to Normal mode
315 In Select mode every movement will extend the selection, as
316 opposed to replacing it.
318 1. Move the cursor to the line marked '-->' below.
319 2. Move to the F of FOO and type v2w to select the two words.
320 3. Type d to remove the two words. Notice d returns you to
322 4. Move to the B of BAZ and repeat the sequence to delete them.
324 --> Remove the FOO BAR distracting words BAZ BIZ from this line.
331=================================================================
332= 3.6 SELECTING LINES =
333=================================================================
335 Type x to select a whole line. Type x again to select the next.
337 1. Move the cursor to the second line marked '-->' below.
338 2. Type x to select the line, and d to delete it.
339 3. Move to the fourth line.
340 4. Type x twice or type 2x to select 2 lines, and d to delete.
342 --> 1) Roses are red,
344 --> 3) Violets are blue,
346 --> 5) Clocks tell time,
347 --> 6) Sugar is sweet,
348 --> 7) And so are you.
350 Note : X works similarly to x although it doesn't extend to
351 subsequent lines. X on an empty line does nothing.
353=================================================================
354= 3.7 COLLAPSING SELECTIONS =
355=================================================================
357 Type ; to collapse selections to single cursors.
359 Sometimes, you want to deselect without having to move the
360 cursor(s). This can be done using the ; key.
362 1. Move the cursor to the line marked '-->' below.
363 2. Use the motions you have learned to move around the line,
364 and try using ; to deselect the text after it is selected
367 --> This is an error-free line with words to move around in.
369 Note: This works the same in Select mode.
370 Note: Another related command is Alt-; which flips selections.
375=================================================================
377=================================================================
379 * Type w to select forward until the next word.
380 * Type e to select to the end of the current word.
381 * Type b to select backward to the start of the current word.
382 * Use uppercase counterparts, W,E,B, to traverse WORDS.
384 * Type d to delete the entire selection.
385 * Type c to delete the selection and enter Insert mode.
387 * Type a number before a motion to repeat it that many times.
389 * Type v to enter Select mode, where all motions extend the
392 * Type x to select the entire current line. Type x again to
393 select the next line.
395 * Type semicolon ( ; ) to collapse selection.
397=================================================================
399=================================================================
401 Type u to undo. Type U to redo.
403 1. Move the cursor to the line marked '-->' below.
404 2. Move to the first error, and type d to delete it.
405 3. Type u to undo your deletion.
406 4. Fix all the errors on the line.
407 5. Type u several times to undo your fixes.
408 6. Type U (Shift-u) several times to redo your fixes.
410 --> Fiix the errors on thhis line and reeplace them witth undo.
419=================================================================
420= 4.2 COPYING AND PASTING TEXT =
421=================================================================
423 Type y to yank (copy) the selection.
424 Type p to paste the yanked selection after the cursor.
425 Type P to paste the yanked text before the cursor.
427 1. Move the cursor to the line marked '-->' below.
428 Make sure your cursor is on the "b" of banana.
429 2. Type w to select "banana" and y to yank it.
430 3. Move to the space between "2" and "3" and type p to paste.
431 4. Repeat between "3" and "4".
434 1 banana 2 banana 3 banana 4
436 Note: Whenever you delete or change text, Helix will copy the
437 altered text. Use Alt-d / Alt-c instead to avoid this.
438 Note: Helix doesn't share the system clipboard by default. Type
439 Space + y / p to yank / paste on the system's clipboard.
441=================================================================
442= 4.3 SEARCHING IN FILE =
443=================================================================
445 Type / to search forward in file, Enter to confirm search.
446 Type n to go to the next search match.
447 Type N to go to the previous search match.
449 1. Type / and type in a common word, like 'banana'.
450 2. Type Enter to confirm the search.
451 3. Use n and N to cycle through the matches.
453 Searching uses regular expressions, allowing you to target more
454 complex expressions, which you'll learn about in the lesson on
457 Note: To search backwards, type ? (Shift-/).
458 Note: Unlike Vim, ? doesn't change the search direction.
459 N always goes backwards and n always goes forwards.
463=================================================================
465=================================================================
467 * Type u to undo. Type U to redo.
469 * Type y to yank (copy) text and p to paste.
470 * Use Space + y and Space + p to yank / paste on the system
473 * Type / to search forward in file, and ? to search backwards.
474 * Use n and N to cycle through search matches.
485=================================================================
486= 5.1 MULTIPLE CURSORS =
487=================================================================
489 Type C to duplicate the cursor to the next suitable line.
491 1. Move the cursor to the first line marked '-->' below. Place
492 the cursor somewhere past the '-->'.
493 2. Type C to duplicate the cursor to the next suitable line.
494 Notice how it skips the line in the middle. Keys you type
495 will now affect both cursors.
496 3. Use Insert mode to correct the lines. The two cursors will
497 fix both lines simultaneously.
498 4. Type , to remove the second cursor.
500 --> Fix th two nes at same ime.
502 --> Fix th two nes at same ime.
503 Fix these two lines at the same time.
505 Note: Type Alt-C to do the same above the cursor.
507=================================================================
508= 5.2 THE SELECT COMMAND =
509=================================================================
511 Type s to select matches in the selection.
513 1. Move the cursor to the line marked '-->' below.
514 2. Type x to select the line.
515 3. Type s. A prompt will appear.
516 4. Type 'apples' and type Enter. Both occurrences of
517 'apples' in the line will be selected.
518 5. You can now type c and change 'apples' to something else,
520 6. Type Escape to exit Insert mode.
521 7. Type , to remove the second cursor.
523 --> I like to eat apples since my favorite fruit is apples.
524 I like to eat oranges since my favorite fruit is oranges.
529=================================================================
530= 5.3 SELECTING VIA REGEX =
531=================================================================
533 Like searching, the select command selects regular expressions,
534 not just exact matches.
536 1. Move the cursor to the line marked '-->' below.
537 2. Select the line with x and then type s.
538 3. Enter ' +' to select any amount of consecutive spaces >1.
539 4. Type c and change the matches to single spaces.
541 --> This sentence has some extra spaces.
542 This sentence has some extra spaces.
544 Note: If you want to perform find-and-replace, the select
545 command is the way to do it. Select the text you want
546 to replace in — type % to select the whole file — and
547 then perform the steps explained above.
551=================================================================
552= 5.4 ALIGN SELECTIONS =
553=================================================================
555 Type & to align the contents of the selections.
557 1. Move the cursor to the first line marked '-->' below. Place
558 the cursor on the whitespace just after the arrow.
559 2. Type C four times or 4C.
560 3. Type W to select the numbers and brackets.
561 4. Type & to align the words.
569 Note: & only cares about the alignment of the "head" of the
570 selections - the end that moves. The other end is called
573=================================================================
574= 5.5 SPLIT SELECTION INTO LINES =
575=================================================================
577 Type Alt-s to split the selection(s) on newlines.
579 1. Move the cursor to the first row of the table below.
580 2. Select the entire table with 6x.
581 3. Type Alt-s to split into selections at each line.
582 4. Align the table with &.
595=================================================================
597=================================================================
599 * Type C to duplicate the cursor to the next suitable line
600 and Alt-C for previous suitable line.
602 * Type s to select all instances of a regex pattern inside
603 the current selection.
605 * Type & to align selections.
607 * Type Alt-s to split the selection into lines.
617=================================================================
618= 6.1 SELECTING TO A CHARACTER =
619=================================================================
621 Type f<ch> to select up to and including (find) a character.
622 Type t<ch> to do the same, but not including (till) a character.
623 Type uppercase F / T to do the same backwards.
625 1. Move the cursor to the line marked '-->' below. Place the
626 cursor on the first dash.
627 2. Type f[ to select to the square bracket.
628 3. Type d to delete your selection.
629 4. Go to the end of the line and repeat with F].
630 5. Move to the second line marked '-->', just after the arrow.
631 6. Use t and T to delete the dashes around the sentence.
633 --> -----[Free this sentence of its brackets!]-----
634 --> ------Free this sentence of its dashes!------
636 Note: Unlike Vim, Helix doesn't limit these commands to the
637 current line. It searches for the character in the file.
639=================================================================
640= 6.2 THE REPLACE COMMAND =
641=================================================================
643 Type r<ch> to replace all selected characters with <ch>.
645 1. Move to the second line of the table, place the cursor on the
647 2. Type t| (Shift-\) to select the = separator.
648 3. Type r- to replace the separator with dashes.
661=================================================================
663=================================================================
665 Type . to repeat the last insert command.
666 Type Alt-. to repeat the last f / t selection.
668 1. Move the cursor to the line marked '-->' below.
669 2. Make a change, insertion or appendage and repeat it with . .
670 3. Try using Alt-. with f and t, to select multiple sentences
673 --> This is some text for you to repeat things. You can repeat
674 insertions like changing words, or repeat selections like
683=================================================================
685=================================================================
687 * Type f / F to extend selection up to & including a character.
688 * Type t / T to extend selection until a character.
690 * Type r to replace selected characters.
692 * Type . to repeat the last insertion.
693 * Type Alt-. to repeat the last f / t selection.
705=================================================================
706= 7.1 REPLACE WITH YANKED TEXT =
707=================================================================
709 Type R to replace the selection with previously yanked text.
711 1. Move the cursor to the line marked '-->' below.
712 2. Type w to select "watermelons" and then y to yank it.
713 3. Select "oranges" with w.
714 4. Type R to replace "oranges" with "watermelons"
717 --> I like watermelons because oranges are refreshing.
718 I like watermelons because watermelons are refreshing.
727=================================================================
729=================================================================
731 Type J to join together lines in selection.
733 1. Move the cursor to the line marked '-->' below.
734 2. Type x four times or 4x to select all four lines.
735 3. Type J to join the lines together.
742 This sentence is spilling over onto other lines.
749=================================================================
750= 7.3 INDENTING LINES =
751=================================================================
753 Type > to indent a line and < to outdent it.
755 1. Move the cursor to the line marked '-->' below.
756 2. Move down to the second line and type > to indent it.
757 3. Move to the third line and type < to outdent it.
771=================================================================
772= 7.4 INCREMENTING AND DECREMENTING =
773=================================================================
775 Type Ctrl-a to increment the number under selection.
776 Type Ctrl-x to decrement the number under selection.
778 1. Move the cursor to the third line marked '-->' below.
779 2. Type Ctrl-a to increment the second point marked 2.
780 3. Repeat for the point marked 3.
781 4. Move to the last point and type Ctrl-x to decrement the 6.
786 --> 3) Another point.
789 Note: If there isn't a number under the selection the cursor
790 will jump to the next number in the line and act on it.
793=================================================================
795=================================================================
797 * Type R to replace the selection with yanked text.
799 * Type J to join lines in selection.
801 * Type < and > to indent / outdent lines.
803 * Type Ctrl-a to increment the selected number.
804 * Type Ctrl-x to decrement the selected number.
815=================================================================
817=================================================================
819 Registers are containers identified by a character for storing
820 things like yanked text. Registers are also used to store the
821 most recent search term as well as macros, which you'll learn
822 about in the next section.
824 Type "<ch> to select register <ch>.
826 1. Move the cursor to the line marked '-->' below.
827 2. Type w to select "watermelons" and yank with y.
828 3. Type w to select "bananas".
829 4. Change to register b with "b and yank with y.
830 5. Select "mangoes" and type R to replace it with "watermelons".
831 6. Select "pineapples" then type "b R to replace with "bananas".
833 --> I like watermelons and bananas because my favorite fruits
834 are mangoes and pineapples.
837=================================================================
839=================================================================
841 Macros are a way to record a set of actions you want to repeat.
842 You can also record macros to a specific register (default @).
843 Type Q to start recording a macro - you should see a popup at
844 the bottom of your screen. Type Q again to stop recording.
845 Type q to repeat the macro from register @ (the default).
847 1. Move the cursor to the first line marked '-->' below.
848 Ensure your cursor is on the '>' of the arrow.
849 2. Type Q to start recording.
850 3. Edit the line to look like the bottom one.
851 4. Exit insert and Type Q again to stop recording.
852 5. Move to the line below and put your cursor on '>' again.
853 6. Type q to repeat the macro.
855 --> ... sentence doesn't have it's first and last ... .
856 --> ... sentence doesn't have it's first and last ... .
857 This sentence doesn't have it's first and last word.
859=================================================================
861=================================================================
863 * Type " to select a different register.
865 * Type Q to start and stop recording a macro to a register,
868 * Type q to replay a macro from @ or the selected register.
881=================================================================
882= 9.1 SEARCHING FOR SELECTIONS =
883=================================================================
885 The most recent search with / is stored in register /.
886 n and N both refer to register /, this means we can set that
887 register without having to type in a search.
889 Type * to copy the selection into register /, setting the search
890 term to the selection. This copies the primary selection, which
891 you will learn about in the section on cycling selections.
893 1. Move the cursor to the line marked '-->' below.
894 2. Select "horse" with e and type *.
895 3. Use n and N to jump between the instances of "horse".
897 --> A horse is a horse, of course, of course,
898 --> And no one can talk to a horse of course.
900 Note: * is like a shorthand for "/ y as all it really does is
901 copy the selection into the / register.
903=================================================================
904= 9.2 ADDING SELECTION ON NEXT SEARCH MATCH =
905=================================================================
907 A property of Select mode (v) when using n and N is that instead
908 of moving the selection to the next match, it adds a new
909 selection on each match.
911 1. Move the cursor to the line marked '-->' below.
912 2. Select the first "bat" and type * to set it to search.
913 3. Type v to enter Select mode.
914 4. Type n to select the other "bat".
915 5. Use c or r to change the "bat"s to "cat".
917 --> Everybody wants to be a bat,
918 --> because a cat's the only bat
919 --> who knows where it's at.
925=================================================================
926= 9.3 USING THE JUMPLIST =
927=================================================================
929 Helix can keep track of "jumps" which are big movements, like
930 searching or jumping to the definition of a function in code. It
931 stores these in what's called the jumplist.
933 Type Ctrl-s to manually save your current position to
936 Type Ctrl-i ("in") and Ctrl-o ("out") to move forward and
937 backwards in the jumplist respectively.
939 1. Type Ctrl-s somewhere.
940 2. Move far away in the file.
941 3. Type Ctrl-o (just once!) to come back to where you saved.
947=================================================================
949=================================================================
951 * Type * to set the search register to the primary selection.
953 * Type n / N in Visual mode to add selections on each search
956 * Type Ctrl-s to save position to the jumplist.
957 * Type Ctrl-i and Ctrl-o to go forward and backward in the
969=================================================================
970= 10.1 CYCLING AND REMOVING SELECTIONS =
971=================================================================
973 Type ) and ( to cycle the primary selection forward and backward
974 through selections respectively.
976 Type Alt-, to remove the primary selection.
978 1. Move the cursor to the line marked '-->' below.
979 2. Select both lines with xx or 2x.
980 3. Type s to select, type "would" and enter.
981 4. Use ( and ) to cycle the primary selection and remove the
982 very second "would" with Alt-, .
983 5. Type c "wood" to change the remaining "would"s to "wood".
985 --> How much would would a wouldchuck chuck
986 --> if a wouldchuck could chuck would?
988 Note: Additionally, Alt-( and Alt-) cycle the *contents* of the
991=================================================================
992= 10.2 CHANGING CASE =
993=================================================================
995 Type ~ to switch the case of all selected letters.
996 Type ` to set all selected letters to lowercase.
997 Type Alt-` to set all selected letters to uppercase.
999 1. Move the cursor to the first line marked '-->' below.
1000 2. Select each wrongly capitalised or lowercase letter
1001 and type ~ over them.
1002 3. Move to the second line marked '-->'.
1003 4. Type x to select the line.
1004 5. Type ` to change the line to lowercase.
1005 6. Move to the third line marked '-->'.
1006 7. Type x to select the line.
1007 8. Type Alt-` to change the line to uppercase.
1009 --> thIs sENtencE hAs MIS-cApitalIsed leTTerS.
1010 --> this SENTENCE SHOULD all be in LOWERCASE.
1011 --> THIS sentence should ALL BE IN uppercase!
1013=================================================================
1014= 10.3 SPLITTING SELECTIONS =
1015=================================================================
1017 Type S to split each selection on a regex pattern.
1019 1. Move the cursor to the line under ---.
1020 2. Type xx / 2x to select the lines.
1021 3. Type S then \. |! Enter (note the spaces after . and !).
1022 This effectively splits the selection into sentences at each
1023 dot or exclamation mark.
1024 4. Type Alt-; to reverse the selections.
1025 5. Type ; to reduce selections to a single character - the first
1026 letter of each sentence.
1027 6. Type Alt-` to convert all selected letters to uppercase.
1030these are sentences. some sentences don't start with uppercase
1031letters! that is not good grammar. you can fix this.
1035=================================================================
1037=================================================================
1039 * Use ) and ( to cycle the primary selection back and forward
1040 through selections respectively.
1041 * Type Alt-, to remove the primary selection.
1043 * Type ~ to alternate case of selected letters.
1044 * Use ` and Alt-` to set the case of selected letters to
1045 upper and lower respectively.
1047 * Type S to split selections on regex.
1057=================================================================
1059=================================================================
1075=================================================================
1076 This tutorial is still a work-in-progress.
1077 More sections are planned.
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list