Add space back to main text in the tutor after chapter 11 (#11117)

pull/9915/merge
David Else 4 months ago committed by GitHub
parent 9d75385062
commit 8229a40da8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -145,7 +145,7 @@
You can also type wq or write-quit to save and exit. You can also type wq or write-quit to save and exit.
Note: You can optionally enter a filepath after the w / write Note: You can optionally enter a file path after the w / write
command in order to save to that path. command in order to save to that path.
Note: If there are any unsaved changes to a file, a plus [+] Note: If there are any unsaved changes to a file, a plus [+]
will appear next to the file name in the status bar. will appear next to the file name in the status bar.
@ -1124,14 +1124,14 @@ letters! that is not good grammar. you can fix this.
= 11.1 COMMENTING A LINE = = 11.1 COMMENTING A LINE =
================================================================= =================================================================
Press Ctrl-c to comment the line under your cursor. Press Ctrl-c to comment the line under your cursor.
To uncomment the line, press Ctrl-c again. To uncomment the line, press Ctrl-c again.
1. Move your cursor to the line marked '-->' below. 1. Move your cursor to the line marked '-->' below.
2. Now comment the line marked with '-->'. 2. Now comment the line marked with '-->'.
3. Now try uncommenting the line. 3. Now try uncommenting the line.
--> Comment me please --> Comment me please
@ -1146,23 +1146,23 @@ To uncomment the line, press Ctrl-c again.
= 11.2 COMMENTING MULTIPLE LINES = = 11.2 COMMENTING MULTIPLE LINES =
================================================================= =================================================================
Using the selections and multi-cursor functionality, you can Using the selections and multi-cursor functionality, you can
comment multiple lines as long as it is under the selection or comment multiple lines as long as it is under the selection or
cursors. cursors.
1. Move your cursor to the line marked with '-->' below. 1. Move your cursor to the line marked with '-->' below.
2. Now try to select or add more cursors the other lines marked 2. Now try to select or add more cursors the other lines marked
with '-->'. with '-->'.
3. Comment those lines. 3. Comment those lines.
--> How many are you going to comment? --> How many are you going to comment?
--> Is this enough for a comment? --> Is this enough for a comment?
--> What are you doing?! --> What are you doing?!
--> Stop commenting me! --> Stop commenting me!
--> AAAAaargh!!! --> AAAAaargh!!!
Note: If there are already commented lines under selections or Note: If there are already commented lines under selections or
multiple cursors, they won't be uncommented but commented again. multiple cursors, they won't be uncommented but commented again.
================================================================= =================================================================
= CHAPTER 11 RECAP = = CHAPTER 11 RECAP =
@ -1190,20 +1190,20 @@ multiple cursors, they won't be uncommented but commented again.
= 12.1 USING MATCH MODE JUMP = = 12.1 USING MATCH MODE JUMP =
================================================================= =================================================================
To switch to match mode from normal mode, type m. This feature To switch to match mode from normal mode, type m. This feature
is particularly useful for handling bracket pairs and their is particularly useful for handling bracket pairs and their
contents. contents.
There are several actions that can be performed in match mode, There are several actions that can be performed in match mode,
as indicated by the help pop-up. To jump to a matching bracket pair, as indicated by the help pop-up. To jump to a matching bracket pair,
simply press mm. For example on the lines below (starting with simply press mm. For example on the lines below (starting with
-->), move the cursor in normal mode to (, and then press mm to jump -->), move the cursor in normal mode to (, and then press mm to jump
to the matching ). You can do the same on the line below: for example to the matching ). You can do the same on the line below: for example
move to ], and press mm to jump to [ . move to ], and press mm to jump to [ .
--> you can (jump between matching parenthesis) --> you can (jump between matching parenthesis)
--> or between matching [ square brackets ] --> or between matching [ square brackets ]
--> now { you know the drill: this works with brackets too } --> now { you know the drill: this works with brackets too }
@ -1212,41 +1212,41 @@ move to ], and press mm to jump to [ .
= 12.2 USING MATCH MODE SELECT INSIDE = = 12.2 USING MATCH MODE SELECT INSIDE =
================================================================= =================================================================
Match mode also lets you select the "inside" content between a Match mode also lets you select the "inside" content between a
pair of brackets or other delimiters. In the lines below: pair of brackets or other delimiters. In the lines below:
- move to the --> line, put your cursor in normal mode at any - move to the --> line, put your cursor in normal mode at any
location between the parenthesis, for example at 'x', and press location between the parenthesis, for example at 'x', and press
mi( or mi) to select the whole content inside the parenthesis mi( or mi) to select the whole content inside the parenthesis
(parenthesis excluded). As usual, you can then do anything you want (parenthesis excluded). As usual, you can then do anything you want
with the selection (for example, press c to change it) with the selection (for example, press c to change it)
--> outside and (inside x parenthesis) - and outside again --> outside and (inside x parenthesis) - and outside again
Test below that you can do the same with [], or {}, or with Test below that you can do the same with [], or {}, or with
nested combinations of these (this will act on the immediately nested combinations of these (this will act on the immediately
surrounding matching pair). This also works with "" and similar surrounding matching pair). This also works with "" and similar
--> test [ with square brackets ] ! --> test [ with square brackets ] !
--> try ( with nested [ pairs of ( parenthesis) and "brackets" ]) --> try ( with nested [ pairs of ( parenthesis) and "brackets" ])
================================================================= =================================================================
= 12.3 USING MATCH MODE SELECT AROUND = = 12.3 USING MATCH MODE SELECT AROUND =
================================================================= =================================================================
You can also select the "around" content, i.e. both the inside You can also select the "around" content, i.e. both the inside
content and the delimiters themselves, by using the ma select. content and the delimiters themselves, by using the ma select.
For example, move to the line under, move your cursor in normal For example, move to the line under, move your cursor in normal
mode to any position between the (), and select the content of mode to any position between the (), and select the content of
the (), including the surrounding (), by typing ma( or ma). As the (), including the surrounding (), by typing ma( or ma). As
usual, you can do anything you want with the selection, for usual, you can do anything you want with the selection, for
example delete it all with ma(d . example delete it all with ma(d .
--> you ( select x around ) to include delimiters in the select --> you ( select x around ) to include delimiters in the select
This naturally works with other delimiters too: This naturally works with other delimiters too:
--> try [ with 'square' brackets ] too! --> try [ with 'square' brackets ] too!
@ -1256,21 +1256,21 @@ This naturally works with other delimiters too:
= 12.4 USING MATCH MODE SURROUND = = 12.4 USING MATCH MODE SURROUND =
================================================================= =================================================================
The match mode can also be used to add surrounding around the The match mode can also be used to add surrounding around the
current selection. For example, move to the line below, then: current selection. For example, move to the line below, then:
* i) select the "select all of this" line segment (for example, * i) select the "select all of this" line segment (for example,
move in normal mode the cursor to the start of select, then enter move in normal mode the cursor to the start of select, then enter
selection mode with v , then select the 4 next words with 4e ), selection mode with v , then select the 4 next words with 4e ),
* ii) press ms( or ms) to surround the selection with a pair of * ii) press ms( or ms) to surround the selection with a pair of
parenthesis. parenthesis.
--> so, select all of this, and surround it with () --> so, select all of this, and surround it with ()
You can do the same with other delimiters: for example, ms' on You can do the same with other delimiters: for example, ms' on
WORD below to surround it with a pair of ''. You can try also WORD below to surround it with a pair of ''. You can try also
with adding a surrounding pair of "", or {}, or []. with adding a surrounding pair of "", or {}, or [].
--> surround this WORD ! --> surround this WORD !
@ -1278,52 +1278,52 @@ with adding a surrounding pair of "", or {}, or [].
= 12.5 USING MATCH MODE DELETE SURROUND = = 12.5 USING MATCH MODE DELETE SURROUND =
================================================================= =================================================================
You can delete surrounding pair of delimiters with the md You can delete surrounding pair of delimiters with the md
command. On the line below, move the cursor anywhere command. On the line below, move the cursor anywhere
within the pair of (), for example to the 'x', then from there, within the pair of (), for example to the 'x', then from there,
in normal mode, press md( or md) to delete the surrounding in normal mode, press md( or md) to delete the surrounding
pair of parenthesis. pair of parenthesis.
--> delete (the x pair of parenthesis) from within! --> delete (the x pair of parenthesis) from within!
You can naturally delete other kinds of surroundings: You can naturally delete other kinds of surroundings:
--> delete (nested [delimiters]): "this" will delete the nearest --> delete (nested [delimiters]): "this" will delete the nearest
matching surrounding pair. matching surrounding pair.
--> delete "layers "of" quote marks" too: this will delete the --> delete "layers "of" quote marks" too: this will delete the
nearest previous and following quote marks nearest previous and following quote marks
Trying to delete unexisting surrounding delimiters print an error Trying to delete unexisting surrounding delimiters print an error
at the bottom bar and does nothing. at the bottom bar and does nothing.
================================================================= =================================================================
= 12.6 USING MATCH MODE REPLACE SURROUND = = 12.6 USING MATCH MODE REPLACE SURROUND =
================================================================= =================================================================
You can replace surrounding pairs of delimiters with the mr You can replace surrounding pairs of delimiters with the mr
command. On the line below, move the cursor to command. On the line below, move the cursor to
anywhere within the pair of (), for example on the 'x', then in anywhere within the pair of (), for example on the 'x', then in
normal mode, press mr([ to replace the pair of () with a pair normal mode, press mr([ to replace the pair of () with a pair
of []. of [].
--> replace the (pair from x within), with something else --> replace the (pair from x within), with something else
This command will act on the closest enclosing pair, so you This command will act on the closest enclosing pair, so you
can try replacing different surrounding in the following: can try replacing different surrounding in the following:
--> some (nested surroundings [can be replaced]) --> some (nested surroundings [can be replaced])
--> this "works with 'other surroundings' too" --> this "works with 'other surroundings' too"
You can try to replace a non existing pair: this will show You can try to replace a non existing pair: this will show
an error warning at the bottom bar and do nothing. an error warning at the bottom bar and do nothing.
================================================================= =================================================================
= CHAPTER 12 RECAP = = CHAPTER 12 RECAP =
================================================================= =================================================================
You can enter the match mode with the m key; this will show the You can enter the match mode with the m key; this will show the
actions available in a popup. This will allow you to: actions available in a popup. This will allow you to:
* jump to matching pair of delimiters with mm (you must have a * jump to matching pair of delimiters with mm (you must have a
delimiter belonging to a pair under your cursor) delimiter belonging to a pair under your cursor)
* select inside a pair of delimiters surrounding your cursor * select inside a pair of delimiters surrounding your cursor
@ -1344,20 +1344,20 @@ actions available in a popup. This will allow you to:
= CHAPTER 13.1 CREATE NEW SPLIT = = CHAPTER 13.1 CREATE NEW SPLIT =
================================================================= =================================================================
In Normal mode, press Ctrl-w to open the Window menu, which displays In Normal mode, press Ctrl-w to open the Window menu, which displays
a list of available commands. a list of available commands.
To open a new empty buffer in a vertical split on the right half To open a new empty buffer in a vertical split on the right half
of your current window, use Ctrl-w nv (i.e., press Ctrl of your current window, use Ctrl-w nv (i.e., press Ctrl
and w simultaneously, then press n, followed by v). Your current and w simultaneously, then press n, followed by v). Your current
window will now split in 2 vertically. A new empty buffer split window will now split in 2 vertically. A new empty buffer split
will appear on the right half and your cursor will jump to the will appear on the right half and your cursor will jump to the
new vertical split. new vertical split.
To create a new empty buffer in a horizontal split, press To create a new empty buffer in a horizontal split, press
Ctrl-w ns. This action divides your current window into two Ctrl-w ns. This action divides your current window into two
horizontally, creates a new buffer, and moves your cursor to the horizontally, creates a new buffer, and moves your cursor to the
new horizontal split. new horizontal split.
@ -1366,33 +1366,33 @@ new horizontal split.
= CHAPTER 13.2 MOVE BETWEEN SPLITS = = CHAPTER 13.2 MOVE BETWEEN SPLITS =
================================================================= =================================================================
Use Ctrl-w k to move to the split above your current split. Use Use Ctrl-w k to move to the split above your current split. Use
Ctrl-w j to move to the split below. Use Ctrl-w h to move to Ctrl-w j to move to the split below. Use Ctrl-w h to move to
the split on the left and Ctrl-w l to move to the split on the the split on the left and Ctrl-w l to move to the split on the
right. To navigate to the next split (in the order they were right. To navigate to the next split (in the order they were
opened), press Ctrl-w w. opened), press Ctrl-w w.
You can now do whatever you want in your new buffers and splits. You can now do whatever you want in your new buffers and splits.
Once you are done with using your new buffer split, Once you are done with using your new buffer split,
you can close it with Ctrl-w q . Move to the bottom right split you can close it with Ctrl-w q . Move to the bottom right split
with Ctrl-w l then Ctrl-w j, then press Ctrl-w q to close this with Ctrl-w l then Ctrl-w j, then press Ctrl-w q to close this
specific split. specific split.
You can also close all splits except the current one with Ctrl-w o . You can also close all splits except the current one with Ctrl-w o .
Open a third vertical split with Ctrl-w nv , then move to the Open a third vertical split with Ctrl-w nv , then move to the
leftmost split with Ctrl-w h twice, then from inside the split on leftmost split with Ctrl-w h twice, then from inside the split on
the left press Ctrl-w o to close all except this split. the left press Ctrl-w o to close all except this split.
================================================================= =================================================================
= CHAPTER 13.3 SPLIT CURRENT BUFFER = = CHAPTER 13.3 SPLIT CURRENT BUFFER =
================================================================= =================================================================
Use Ctrl-w s to split the view of the current buffer horizontally Use Ctrl-w s to split the view of the current buffer horizontally
and Ctrl-w v to split it vertically with the buffer opened in both and Ctrl-w v to split it vertically with the buffer opened in both
splits. splits.
Close extra splits with Ctrl-w o to return to a single window view. Close extra splits with Ctrl-w o to return to a single window view.
@ -1410,41 +1410,41 @@ Close extra splits with Ctrl-w o to return to a single window view.
= CHAPTER 13.4 USE COMMANDS TO SPLIT = = CHAPTER 13.4 USE COMMANDS TO SPLIT =
================================================================= =================================================================
The :vsplit (or :vs for short) and :hsplit (or :hs) commands can The :vsplit (or :vs for short) and :hsplit (or :hs) commands can
also be used to split a specific buffer vertically or horizontally. also be used to split a specific buffer vertically or horizontally.
For example, enter the command: For example, enter the command:
:vs something :vs something
to open a new vertical split named "something" to the right. Here, to open a new vertical split named "something" to the right. Here,
"something" is not an existing file, so a new buffer with this name "something" is not an existing file, so a new buffer with this name
will open; however, you can replace "something" with any file name will open; however, you can replace "something" with any file name
to open it in a new buffer. Similarly, you can enter the command: to open it in a new buffer. Similarly, you can enter the command:
:hs some_more :hs some_more
to open a new buffer named "some_more" in the lower half. to open a new buffer named "some_more" in the lower half.
"some_more" could be any file or path to open this specific file "some_more" could be any file or path to open this specific file
or path instead of a new empty buffer. or path instead of a new empty buffer.
================================================================= =================================================================
= CHAPTER 13.5 SWAPPING SPLITS = = CHAPTER 13.5 SWAPPING SPLITS =
================================================================= =================================================================
Open a split on the left with :vs hello1 and then a split below Open a split on the left with :vs hello1 and then a split below
with :hs hello2. with :hs hello2.
From hello2, press Ctrl-w K to swap it with the split above. Now From hello2, press Ctrl-w K to swap it with the split above. Now
hello2 is at the top while hello1 is at the bottom. hello2 is at the top while hello1 is at the bottom.
Still from hello2, press Ctrl-w H to swap with the split on the Still from hello2, press Ctrl-w H to swap with the split on the
left: now hello2 is on the left and the tutor is on the top left: now hello2 is on the left and the tutor is on the top
right. After Ctrl-w you can use HJKL to split with the buffer right. After Ctrl-w you can use HJKL to split with the buffer
on the left / below / above / on the right. on the left / below / above / on the right.
Move back to the tutor split, and press Ctrl-w o to only keep Move back to the tutor split, and press Ctrl-w o to only keep
this split. this split.
@ -1454,21 +1454,21 @@ this split.
= CHAPTER 13.6 TRANSPOSE SPLITS = = CHAPTER 13.6 TRANSPOSE SPLITS =
================================================================= =================================================================
Open a split on the left with :vs hello1 and then a split below Open a split on the left with :vs hello1 and then a split below
with :vs hello2. with :vs hello2.
Move to the tutor split, then press Ctrl-w t to transpose the Move to the tutor split, then press Ctrl-w t to transpose the
vertical split opened from this window: now, hello1 and vertical split opened from this window: now, hello1 and
hello2 are below, rather than to the right of, the tutor. Press hello2 are below, rather than to the right of, the tutor. Press
Ctrl-w t again to transpose back. Ctrl-w t again to transpose back.
Move to the hello1 split, then press Ctrl-w t to transpose the Move to the hello1 split, then press Ctrl-w t to transpose the
horizontal split that was opened from this window: now hello2 horizontal split that was opened from this window: now hello2
is on the right, rather than below, hello1. Press Ctrl-w t to is on the right, rather than below, hello1. Press Ctrl-w t to
transpose back. transpose back.
Move back to the tutor split and press Ctrl-w o to close all but Move back to the tutor split and press Ctrl-w o to close all but
the tutor window. the tutor window.
@ -1476,21 +1476,21 @@ the tutor window.
= CHAPTER 13.7 OPEN SPLIT FROM FILEPICKER = = CHAPTER 13.7 OPEN SPLIT FROM FILEPICKER =
================================================================= =================================================================
Splits can also be opened directly from the file picker. Press Splits can also be opened directly from the file picker. Press
space f to open the file picker. From there, you can type in text space f to open the file picker. From there, you can type in text
to perform file lookup with fuzzy matching, and use the arrows to perform file lookup with fuzzy matching, and use the arrows
up and down to move the selected file (indicated by the > symbol). up and down to move the selected file (indicated by the > symbol).
If you want to exit the file picker, press Escape. If you want to exit the file picker, press Escape.
Select any file you like in the file picker. You could open it in Select any file you like in the file picker. You could open it in
the current view by pressing enter (do not do this at present). the current view by pressing enter (do not do this at present).
But you can also open it in a new split. Press Ctrl-v to open But you can also open it in a new split. Press Ctrl-v to open
the selected file in a new vertical split. Press space f again, the selected file in a new vertical split. Press space f again,
select any file you want, and press Ctrl-s to open it in a select any file you want, and press Ctrl-s to open it in a
horizontal split. horizontal split.
Move back to the tutor split, and press Ctrl-w o to close all Move back to the tutor split, and press Ctrl-w o to close all
splits except this one. splits except this one.
@ -1498,18 +1498,18 @@ splits except this one.
= CHAPTER 13 RECAP = = CHAPTER 13 RECAP =
================================================================= =================================================================
Splits can be used to display either the same buffer several times Splits can be used to display either the same buffer several times
or several buffers. To access the main windows and splits commands, or several buffers. To access the main windows and splits commands,
press Ctrl-w . You can move between splits with Ctrl-w hjkl , press Ctrl-w . You can move between splits with Ctrl-w hjkl ,
you can close a split with Ctrl-w q , and you can close all but you can close a split with Ctrl-w q , and you can close all but
the present split with Ctrl-w o . the present split with Ctrl-w o .
Splits can also be opened by using the :vs FILENAME and Splits can also be opened by using the :vs FILENAME and
:hs FILENAME commands. :hs FILENAME commands.
Splits can also be used directly from the file pickers, by using Splits can also be used directly from the file pickers, by using
Ctrl-v to open the file selected in a new vertical split, and Ctrl-v to open the file selected in a new vertical split, and
Ctrl-s in a horizontal split. Ctrl-s in a horizontal split.

Loading…
Cancel
Save