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 press 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= 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. Press the : key to enter command mode. Your cursor will
50 move to the bottom of the screen.
51 2. Type q or quit and press <ENTER> to exit Helix.
53 Note: The quit command will fail if there are unsaved changes.
54 To force quit and DISCARD these changes, use q! or quit!.
55 You will learn how to save files later.
57 To exit command mode without entering a command, press <ESC>.
59 Now, move on to the next lesson.
67=================================================================
69=================================================================
71 Press the d key to delete the character under the cursor.
73 1. Move the cursor to the line below marked -->.
74 2. Move the cursor to each extra character, and press d to
77 --> Thhiss senttencee haass exxtra charracterss.
79 Once the sentence is correct, move on to the next lesson.
89=================================================================
91=================================================================
93 Press the i key to enter Insert mode.
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
97 i to enter Insert mode. Keys you press will now type text.
98 3. Enter the missing text.
99 4. Press <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: If you want to move the cursor while in Insert mode,
106 you may use the arrow keys instead of exiting and
107 reentering Insert mode.
108 Note: The status bar will display your current mode.
109 Notice that when you press i, 'NOR' changes to 'INS'.
111=================================================================
112= MORE ON INSERT MODE =
113=================================================================
115 As you saw, you can press i to enter Insert mode at the current
116 position of the cursor. There are a few other ways you can
117 enter Insert mode at different locations.
119 Common examples of insertion commands include:
120 i - Insert before the selection.
121 a - Insert after the selection. (a means 'append')
122 I - Insert at the start of the line.
123 A - Insert at the end of the line.
125 1. Move to anywhere in the line below marked -->.
126 2. Press A (<SHIFT> + a), your cursor will move to the end of
127 the line and you will be able to type.
128 3. Type the text necessary to match the line below.
130 --> This sentence is miss
131 This sentence is missing some text.
133=================================================================
135=================================================================
137 Use :w/:write to save a file.
139 1. Exit Helix using :q! as explained before, or open a new
141 2. Open a file in Helix by running: hx FILENAME
142 3. Make some edits to the file.
143 4. Press the : key to enter command mode.
144 5. Type w or write, and press <ENTER> to save the file.
146 You can also use wq or write-quit to save and exit.
148 Note: You can optionally enter a filepath after the w/write
149 command in order to save to that path.
150 Note: If there are any unsaved changes to a file, a plus [+]
151 will appear next to the file name in the status bar.
155=================================================================
157=================================================================
159 * Use the h,j,k,l keys to move the cursor.
161 * Press : to enter command mode.
162 * The q/quit and q!/quit! commands will exit Helix. The
163 former fails when there are unsaved changes. The latter
165 * The w/write command will save the file.
166 * The wq/write-quit command will do both.
168 * Press d to delete the character at the cursor.
170 * Press i to enter Insert mode and type text. Press <ESC> to
171 return to Normal mode.
177=================================================================
178= MOTIONS AND SELECTIONS =
179=================================================================
181 Press w to select forward until the next word.
183 The d key doesn't actually delete the character at the cursor,
184 it deletes all selected text. Your cursor is like a
185 single-character selection.
187 1. Move the cursor to the line below marked -->.
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.
190 4. Press d to delete the selection.
191 5. Repeat for all extra words in the line.
193 --> This sentence pencil has vacuum extra words in the it.
199=================================================================
201=================================================================
203 As you saw, pressing w moves the cursor forward until the start
204 of the next word, selecting the text traversed. This is useful
205 for moving around text and for selecting text to operate on.
207 Some common motions include:
208 w - Move forward to before the beginning of the next word.
209 e - Move forward to the end of the current word.
210 b - Move backward to the beginning of the current word.
212 The w,e,b motions also have counterparts - W,E,B - which
213 traverse WORDS instead of words. WORDS are only separated by
214 whitespace, whereas words can be separated by other characters
215 in addition to whitespace.
217 All of these motions select the text they traverse.
221=================================================================
222= THE CHANGE COMMAND =
223=================================================================
225 Press c to change the current selection.
227 The change command deletes the current selection and enters
228 Insert mode, so it is a very common shorthand for di.
230 1. Move the cursor to the line below marked -->.
231 2. Move to the start of an incorrect word and press w to
233 3. Press c to delete the word and enter Insert mode.
234 4. Type the correct word.
235 5. Repeat until the line matches the line below it.
237 --> This paper has heavy words behind it.
238 This sentence has incorrect words in it.
243=================================================================
244= COUNTS WITH MOTIONS =
245=================================================================
247 Type a number before a motion to repeat it that many times.
249 1. Move the cursor to the line below marked -->.
251 2. Type 2w to move 2 words forward.
253 3. Type 3e to move to the end of the third word forward.
255 4. Type 2b to move 2 words backwards
257 5. Try the above with different numbers.
259 --> This is just a line with words you can move around in.
265=================================================================
267=================================================================
269 Press x to select a whole line. Press again to select the next.
271 1. Move the cursor to the second line below marked -->.
272 2. Press x to select the line, and d to delete it.
273 3. Move to the fourth line.
274 4. Press x twice or type 2x to select 2 lines, and d to delete.
276 --> 1) Roses are red,
278 --> 3) Violets are blue,
280 --> 5) Clocks tell time,
281 --> 6) Sugar is sweet,
282 --> 7) And so are you.
287=================================================================
289=================================================================
291 Type u to undo. Type U to redo.
293 1. Move the cursor to the line below marked -->.
294 2. Move to the first error, and press d to delete it.
295 3. Type u to undo your deletion.
296 4. Fix all the errors on the line.
297 5. Type u several times to undo your fixes.
298 6. Type U (<SHIFT> + u) several times to redo your fixes.
300 --> Fiix the errors on thhis line and reeplace them witth undo.
309=================================================================
311=================================================================
313 * Type w to select forward until the next word.
314 * Type e to select to the end of the current word.
315 * Type b to select backward to the start of the current word.
316 * Use uppercase counterparts, W,E,B, to traverse WORDS.
318 * Typing d deletes the entire selection, so you can delete a
319 word forward by typing wd.
321 * Type c to delete the selection and enter Insert mode.
323 * Type a number before a motion to repeat it that many times.
325 * Type x to select the entire current line. Type x again to
326 select the next line.
328 * Type u to undo. Type U to redo.
331=================================================================
333=================================================================
335 Type C to duplicate the cursor to the next line.
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
339 press will now affect both cursors.
340 3. Use Insert mode to correct the lines. The two cursors will
341 fix both lines simultaneously.
342 4. Type , to remove the second cursor.
344 --> Fix th two nes at same ime.
345 --> Fix th two nes at same ime.
347 Fix these two lines at the same time.
353=================================================================
354= THE SELECT COMMAND =
355=================================================================
357 Type s to select matches in the selection.
359 1. Move the cursor to the line below marked -->.
360 2. Press x to select the line.
361 3. Press s. A prompt will appear.
362 4. Type 'apples' and press <ENTER>. Both occurrences of
363 'apples' in the line will be selected.
364 5. You can now press c and change 'apples' to something else,
366 6. Type , to remove the second cursor.
368 --> I like to eat apples since my favorite fruit is apples.
375=================================================================
376= SELECTING VIA REGEX =
377=================================================================
379 The select command selects regular expressions, not just exact
380 matches, allowing you to target more complex patterns.
382 1. Move the cursor to the line below marked -->.
383 2. Select the line with x and then press s.
384 3. Enter ' +' to select any amount of consecutive spaces >1.
385 4. Press c and change the matches to single spaces.
387 --> This sentence has some extra spaces.
389 Note: If you want to perform find-and-replace, the select
390 command is the way to do it. Select the text you want
391 to replace in — type % to select the whole file — and
392 then perform the steps explained above.
397=================================================================
398= COLLAPSING SELECTIONS =
399=================================================================
401 Type ; to collapse selections to single cursors.
403 Sometimes, you want to deselect without having to move the
404 cursor(s). This can be done using the ; key.
406 1. Move the cursor to the line below marked -->.
408 2. Use the motions you have learned to move around the line,
409 and try using ; to deselect the text after it is selected
412 --> This is an error-free line with words to move around in.
419=================================================================
420 This tutorial is still a work-in-progress.
421 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