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 caps-lock 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 <ESC>.
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 <ESC> 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 <ESC> 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/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 <ESC> 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 A-; 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/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 your computer's main 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.
465=================================================================
467=================================================================
469 * Type u to undo. Type U to redo.
471 * Type y to yank (copy) text and p to paste.
472 * Use space-Y and space-P to yank/paste on the system
475 * Type / to search forward in file, and ? to search backwards.
476 * Use n and N to cycle through search matches.
487=================================================================
488= 5.1 MULTIPLE CURSORS =
489=================================================================
491 Type C to duplicate the cursor to the next suitable line.
493 1. Move the cursor to the first line marked '-->' below.
494 2. Type C to duplicate the cursor to the next suitable line.
495 Notice how it skips the line in the middle. Keys you type
496 will now affect both cursors.
497 3. Use Insert mode to correct the lines. The two cursors will
498 fix both lines simultaneously.
499 4. Type , to remove the second cursor.
501 --> Fix th two nes at same ime.
503 --> Fix th two nes at same ime.
505 Fix these two lines at the same time.
507 Note: Type alt-C to do the same above the cursor.
509=================================================================
510= 5.2 THE SELECT COMMAND =
511=================================================================
513 Type s to select matches in the selection.
515 1. Move the cursor to the line marked '-->' below.
516 2. Type x to select the line.
517 3. Type s. A prompt will appear.
518 4. Type 'apples' and type <ENTER>. Both occurrences of
519 'apples' in the line will be selected.
520 5. You can now type c and change 'apples' to something else,
522 6. Type <ESC> to exit Insert mode.
523 7. Type , to remove the second cursor.
525 --> I like to eat apples since my favorite fruit is apples.
526 I like to eat oranges since my favorite fruit is oranges.
531=================================================================
532= 5.3 SELECTING VIA REGEX =
533=================================================================
535 Like searching, the select command selects regular expressions,
536 not just exact matches.
538 1. Move the cursor to the line marked '-->' below.
539 2. Select the line with x and then type s.
540 3. Enter ' +' to select any amount of consecutive spaces >1.
541 4. Type c and change the matches to single spaces.
543 --> This sentence has some extra spaces.
544 This sentence has some extra spaces.
546 Note: If you want to perform find-and-replace, the select
547 command is the way to do it. Select the text you want
548 to replace in — type % to select the whole file — and
549 then perform the steps explained above.
553=================================================================
554= 5.4 ALIGN SELECTIONS =
555=================================================================
557 Type & to align the contents of the selections.
559 1. Move the cursor to the first line marked '-->' below. Place
560 the cursor on the whitespace just after the arrow.
561 2. Type C four times or 4C.
562 3. Type W to select the numbers and brackets.
563 4. Type & to align the words.
571 Note: & only cares about the alignment of the "head" of the
572 selections - the end that moves. The other end is called
575=================================================================
576= 5.5 SPLIT SELECTION INTO LINES =
577=================================================================
579 Type A-s (Alt-s) to split the selection(s) on newlines.
581 1. Move the cursor to the first row of the table below.
582 2. Select the entire table with 6x.
583 3. Type A-s to split into selections at each line.
584 4. Align the table with &.
597=================================================================
599=================================================================
601 * Type C to copy the current selection to below and Alt-C for
604 * Type s to select all instances of a regex pattern inside
605 the current selection.
607 * Type & to align selections.
609 * Type A-s to split the selection into lines.
619=================================================================
620= 6.1 SELECTING TO A CHARACTER =
621=================================================================
623 Type f<ch> to select up to and including (find) a character.
624 Type t<ch> to do the same, but not including (till) a character.
625 Type uppercase F / T to do the same backwards.
627 1. Move the cursor to the line marked '-->' below. Place the
628 cursor on the first dash.
629 2. Type f[ to select to the square bracket.
630 3. Type d to delete your selection.
631 4. Go to the end of the line and repeat with F].
632 5. Move to the second line marked -->, just after the arrow.
633 6. Use t and T to delete the dashes around the sentence.
635 --> -----[Free this sentence of its brackets!]-----
636 --> ------Free this sentence of its dashes!------
638 Note: Unlike Vim, Helix doesn't limit these commands to the
639 current line. It searches for the character in the file.
641=================================================================
642= 6.2 THE REPLACE COMMAND =
643=================================================================
645 Type r<ch> to replace all selected characters with <ch>.
647 1. Move to the second line of the table, place the cursor on the
649 2. Type t| (Shift-\) to select the = separator.
650 3. Type r- to replace the separator with dashes.
663=================================================================
665=================================================================
667 Type . to repeat the last insert command.
668 Type A-. to repeat the last f / t selection.
670 1. Move the cursor to the line marked '-->' below.
671 2. Make a change, insertion or appendage and repeat it with . .
672 3. Try using A-. with f and t, to select multiple sentences for
675 --> This is some text for you to repeat things. You can repeat
676 insertions like changing words, or repeat selections like f/t.
685=================================================================
687=================================================================
689 * Type f / F to extend selection up to & including a character.
690 * Type t / T to extend selection until a character.
692 * Type r to replace selected characters.
694 * Type . to repeat the last insertion.
695 * Type A-. to repeat the last f / t selection.
707=================================================================
708= 7.1 REPLACE WITH YANKED TEXT =
709=================================================================
711 Type R to replace the selection with previously yanked text.
713 1. Move the cursor to the line marked '-->' below.
714 2. Type w to select "watermelons" and then y to yank it.
715 3. Select "oranges" with w.
716 4. Type R to replace "oranges" with "watermelons"
719 --> I like watermelons because oranges are refreshing.
720 I like watermelons because watermelons are refreshing.
729=================================================================
731=================================================================
733 Type J to join together lines in selection.
735 1. Move the cursor to the line marked '-->' below.
736 2. Type x four times or 4x to select all four lines.
737 3. Type J to join the lines together.
744 This sentence is spilling over onto other lines.
751=================================================================
752= 7.3 INDENTING LINES =
753=================================================================
755 Type > to indent a line and < to outdent it.
757 1. Move the cursor to the line marked '-->' below.
758 2. Move down to the second line and type > to indent it.
759 3. Move to the third line and type < to outdent it.
773=================================================================
774= 7.4 INCREMENTING AND DECREMENTING =
775=================================================================
777 Type C-a to increment the number under selection.
778 Type C-x to decrement the number under selection.
780 1. Move the cursor to the third line marked '-->' below.
781 2. Type C-a to increment the second point marked 2.
782 3. Repeat for the point marked 3.
783 4. Move to the last point and type C-x to decrement the 6.
788 --> 3) Another point.
791 Note: If there isn't a number under the selection the cursor
792 will jump to the next number in the line and act on it.
795=================================================================
797=================================================================
799 * Type R to replace the selection with yanked text.
801 * Type J to join lines in selection.
803 * Type < and > to indent / outdent lines.
805 * Type C-a to increment the selected number.
806 * Type C-x to decrement the selected number.
817=================================================================
819=================================================================
821 Registers are containers identified by a character for storing
822 things like yanked text. Registers are also used to store the
823 most recent search term as well as macros, which you'll learn
824 about in the next section.
826 Type "<ch> to select register <ch>.
828 1. Move the cursor to the line marked '-->' below.
829 2. Type w to select "watermelons" and yank with y.
830 3. Type w to select "bananas".
831 4. Change to register b with "b and yank with y.
832 5. Select "mangoes" and type R to replace it with "watermelons".
833 6. Select "pineapples" then type "b R to replace with "bananas".
835 --> I like watermelons and bananas because my favorite fruits
836 are mangoes and pineapples.
839=================================================================
841=================================================================
843 Macros are a way to record a set of actions you want to repeat.
844 You can also record macros to a specific register (default @).
845 Type Q to start recording a macro - you should see a popup at
846 the bottom of your screen. Type Q again to stop recording.
847 Type q to repeat the macro from register @ (the default).
849 1. Move the cursor to the first line marked '-->' below.
850 Ensure your cursor is on the > of the arrow.
851 2. Type Q to start recording.
852 3. Edit the line to look like the bottom one.
853 4. Exit insert and Type Q again to stop recording.
854 5. Move to the line below and put your cursor on the > again.
855 6. Type q to repeat the macro.
857 --> ... sentence doesn't have it's first and last ... .
858 --> ... sentence doesn't have it's first and last ... .
859 This sentence doesn't have it's first and last word.
861=================================================================
863=================================================================
865 * Type " to select a different register.
867 * Type Q to start and stop recording a macro to a register,
870 * Type q to replay a macro from @ or the selected register.
883=================================================================
884= 9.1 SEARCHING FOR SELECTIONS =
885=================================================================
887 The most recent search with / is stored in register /.
888 n and N both refer to register /, this means we can set that
889 register without having to type in a search.
891 Type * to copy the primary selection into register /, setting
892 the search term to the selection.
894 1. Move the cursor to the line marked '-->' below.
895 2. Select "horse" with e and type *.
896 3. Use n and N to jump between the instances of "horse".
898 --> A horse is a horse, of course, of course,
899 --> And no one can talk to a horse of course.
901 Note: * is like a shorthand for "/ y as all it really does is
902 copy the selection into the / register.
905=================================================================
906= 9.2 ADDING SELECTION ON NEXT SEARCH MATCH =
907=================================================================
909 A property of select mode (v) when using n and N is that instead
910 of moving the selection to the next match, it adds a new
911 selection on each match.
913 1. Move the cursor to the line marked '-->' below.
914 2. Select the first "bat" and type * to set it to search.
915 3. Type v to enter select mode.
916 4. Type n to select the other "bat".
917 5. Use c or r to change the "bat"s to "cat".
919 --> Everybody wants to be a bat,
920 --> because a cat's the only bat
921 --> who knows where it's at.
927=================================================================
928= 9.3 USING THE JUMPLIST =
929=================================================================
931 Helix can keep track of "jumps" which are big movements, like
932 searching or jumping to the definition of a function in code. It
933 stores these in what's called the jumplist.
935 Type C-s (ctrl-s) to manually save your current position to
938 Type C-i ("in") and C-o ("out") to move forward and backwards in
939 the jumplist respectively.
941 1. Type C-s somewhere.
942 2. Move far away in the file.
943 3. Type C-o (just once!) to come back to where you saved.
949=================================================================
951=================================================================
953 * Type * to set the search register to the primary selection.
955 * Type n / N in visual mode to add selections on each search
958 * Type C-s to save position to the jumplist.
959 * Type C-i and C-o to go forward and backward in the jumplist.
971=================================================================
972= 10.1 CYCLING AND REMOVING SELECTIONS =
973=================================================================
975 Type ) and ( to cycle the primary selection forward and backward
976 through selections respectively.
978 Type A-, to remove the primary selection.
980 1. Move the cursor to the line marked '-->' below.
981 2. Select both lines with xx or 2x.
982 3. Type s to select, type "would" and enter.
983 4. Use ( and ) to cycle the primary selection and remove the
984 very second "would" with A-, .
985 5. Type c "wood" to change the remaining "would"s to "wood".
987 --> How much would would a wouldchuck chuck
988 --> if a wouldchuck could chuck would?
990 Note: Additionally, A-( and A-) cycle the *contents* of the
993=================================================================
994= 10.2 CHANGING CASE =
995=================================================================
997 Type ~ to switch the case of all selected letters.
998 Type ` to set all selected letters to lowercase.
999 Type Alt-` to set all selected letters to uppercase.
1001 1. Move the cursor to the first line marked '-->' below.
1002 2. Select each wrongly capitalised or lowercase letter
1003 and type ~ over them.
1004 3. Move to the second line marked -->.
1005 4. Type x to select the line.
1006 5. Type ` to change the line to lowercase.
1007 6. Move to the third line marked -->.
1008 7. Type x to select the line.
1009 8. Type Alt-` to change the line to uppercase.
1011 --> thIs sENtencE hAs MIS-cApitalIsed leTTerS.
1012 --> this SENTENCE SHOULD all be in LOWERCASE.
1013 --> THIS sentence should ALL BE IN uppercase!
1015=================================================================
1016= 10.3 SPLITTING SELECTIONS =
1017=================================================================
1019 Type S to split each selection on a regex pattern.
1021 1. Move the cursor to the line under ---.
1022 2. Type xx / 2x to select the lines.
1023 3. Type S then \. |! <enter> (note the spaces after . and !).
1024 This effectively splits the selection into sentences at each
1025 dot or exclamation mark.
1026 4. Type A-; to reverse the selections.
1027 5. Type ; to reduce selections to a single character - the first
1028 letter of each sentence.
1029 6. Type A-` to convert all selected letters to uppercase.
1032these are sentences. some sentences don't start with uppercase
1033letters! that is not good grammar. you can fix this.
1037=================================================================
1039=================================================================
1041 * Use ) and ( to cycle the primary selection back and forward
1042 through selections respectively.
1043 * Type A-, to remove the primary selection.
1045 * Type ~ to alternate case of selected letters.
1046 * Use ` and A-` to set the case of selected letters to
1047 upper and lower respectively.
1049 * Type S to split selections on regex.
1059=================================================================
1061=================================================================
1077=================================================================
1078 This tutorial is still a work-in-progress.
1079 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