mirror of
https://github.com/neovim/neovim.git
synced 2025-11-15 23:01:24 +00:00
fix(tutor): remove hyperlinks, simplify non-interactive examples #36307
1. Every hyperlink-like element was replaced by `"$1"` (where $1 is the original string showed in the hyperlink); 2. Arrows `--->` were used in lines containing practice examples when no editing text is involved; 3. Context on interactivity was minimally adapted when strictly needed, not to disrupt the original tutor's intent; 4. Tests regarding the tutor file refactored to ensure the new syntax is not flagged as an error.
This commit is contained in:
committed by
GitHub
parent
b9451dfd4c
commit
5e039c8e97
@@ -40,28 +40,28 @@ describe(':Tutor', function()
|
||||
{0: } |
|
||||
{0: }{1:NOTE}: You can also read the output of an external command. For example, |
|
||||
{0: } |
|
||||
{0: } :r {4:!}dir |
|
||||
{0: } ":r !dir" |
|
||||
{0: } |
|
||||
{0: } reads the output of the ls command and puts it below the cursor. |
|
||||
{0: } |
|
||||
{0: }{3:#}{5: Lesson 5 SUMMARY} |
|
||||
{0: } |
|
||||
{0: } 1. {2::!command} executes an external command. |
|
||||
{0: } 1. :!command executes an external command. |
|
||||
{0: } |
|
||||
{0: } Some useful examples are: |
|
||||
{0: } :{4:!}dir - shows a directory listing |
|
||||
{0: } :{4:!}del FILENAME - removes file FILENAME |
|
||||
{0: } ":!dir" - shows a directory listing |
|
||||
{0: } ":!del FILENAME" - removes file FILENAME |
|
||||
{0: } |
|
||||
{0: } 2. {2::w} FILENAME writes the current Neovim file to disk with |
|
||||
{0: } 2. :w FILENAME writes the current Neovim file to disk with |
|
||||
{0: } name FILENAME. |
|
||||
{0: } |
|
||||
{0: } 3. {2:v} motion :w FILENAME saves the Visually selected lines in file |
|
||||
{0: } 3. v motion :w FILENAME saves the Visually selected lines in file |
|
||||
{0: } FILENAME. |
|
||||
{0: } |
|
||||
{0: } 4. {2::r} FILENAME retrieves disk file FILENAME and puts it |
|
||||
{0: } 4. :r FILENAME retrieves disk file FILENAME and puts it |
|
||||
{0: } below the cursor position. |
|
||||
{0: } |
|
||||
{0: } 5. {2::r !dir} reads the output of the dir command and |
|
||||
{0: } 5. :r !dir reads the output of the dir command and |
|
||||
{0: } puts it below the cursor position. |
|
||||
{0: } |
|
||||
]]
|
||||
@@ -72,28 +72,28 @@ describe(':Tutor', function()
|
||||
{0: } |
|
||||
{0: }{1:NOTE}: You can also read the output of an external command. For example, |
|
||||
{0: } |
|
||||
{0: } :r {4:!}ls |
|
||||
{0: } ":r !ls" |
|
||||
{0: } |
|
||||
{0: } reads the output of the ls command and puts it below the cursor. |
|
||||
{0: } |
|
||||
{0: }{3:#}{5: Lesson 5 SUMMARY} |
|
||||
{0: } |
|
||||
{0: } 1. {2::!command} executes an external command. |
|
||||
{0: } 1. :!command executes an external command. |
|
||||
{0: } |
|
||||
{0: } Some useful examples are: |
|
||||
{0: } :{4:!}ls - shows a directory listing |
|
||||
{0: } :{4:!}rm FILENAME - removes file FILENAME |
|
||||
{0: } ":!ls " - shows a directory listing |
|
||||
{0: } ":!rm FILENAME" - removes file FILENAME |
|
||||
{0: } |
|
||||
{0: } 2. {2::w} FILENAME writes the current Neovim file to disk with |
|
||||
{0: } 2. :w FILENAME writes the current Neovim file to disk with |
|
||||
{0: } name FILENAME. |
|
||||
{0: } |
|
||||
{0: } 3. {2:v} motion :w FILENAME saves the Visually selected lines in file |
|
||||
{0: } 3. v motion :w FILENAME saves the Visually selected lines in file |
|
||||
{0: } FILENAME. |
|
||||
{0: } |
|
||||
{0: } 4. {2::r} FILENAME retrieves disk file FILENAME and puts it |
|
||||
{0: } 4. :r FILENAME retrieves disk file FILENAME and puts it |
|
||||
{0: } below the cursor position. |
|
||||
{0: } |
|
||||
{0: } 5. {2::r !ls} reads the output of the ls command and |
|
||||
{0: } 5. :r !ls reads the output of the ls command and |
|
||||
{0: } puts it below the cursor position. |
|
||||
{0: } |
|
||||
]]
|
||||
@@ -105,7 +105,7 @@ describe(':Tutor', function()
|
||||
it('applies hyperlink highlighting', function()
|
||||
local expected = [[
|
||||
{0: }^This concludes Chapter 1 of the Vim Tutor. Consider continuing with |
|
||||
{0: }{2:Chapter 2}. |
|
||||
{0: }Chapter 2. |
|
||||
{0: } |
|
||||
{0: }This was intended to give a brief overview of the Neovim editor, just enough to|
|
||||
{0: }allow you to use it fairly easily. It is far from complete as Neovim has |
|
||||
@@ -146,18 +146,18 @@ describe(':Tutor', function()
|
||||
screen:expect([[
|
||||
{0: }{3:^#}{5: Lesson 2.6: OPERATING ON LINES} |
|
||||
{0: } |
|
||||
{0: }{1: Type }{4:dd}{1: to delete a whole line. } |
|
||||
{0: }{1: Type "dd" to delete a whole line. } |
|
||||
{0: } |
|
||||
{0: }Due to the frequency of whole line deletion, the designers of Vi decided |
|
||||
{0: }it would be easier to simply type two d's to delete a line. |
|
||||
{0: } |
|
||||
{0: } 1. Move the cursor to the second line in the phrase below. |
|
||||
{0: } |
|
||||
{0: } 2. Type {2:dd} to delete the line. |
|
||||
{0: } 2. Type dd to delete the line. |
|
||||
{0: } |
|
||||
{0: } 3. Now move to the fourth line. |
|
||||
{0: } |
|
||||
{0: } 4. Type {9:2}{4:dd} to delete two lines. |
|
||||
{0: } 4. Type "2dd" to delete two lines. |
|
||||
{0: } |
|
||||
{7:✓ }{3:1) Roses are red, }|
|
||||
{11:✗ }{3:2) Mud is fun, }|
|
||||
@@ -169,29 +169,29 @@ describe(':Tutor', function()
|
||||
{0: } |
|
||||
{0: }{3:#}{5: Lesson 2.7: THE UNDO COMMAND} |
|
||||
{0: } |
|
||||
{0: }{1: Press }{4:u}{1: to undo the last commands, }{4:U}{1: to fix a whole line. } |
|
||||
{0: }{1: Press "u" to undo the last commands, "U" to fix a whole line. } |
|
||||
{0: } |
|
||||
{0: } 1. Move the cursor to the line below marked {10:✗} and place it on the first error.|
|
||||
{0: } |
|
||||
{0: } 2. Type {4:x} to delete the first unwanted character. |
|
||||
{0: } 2. Type "x" to delete the first unwanted character. |
|
||||
]])
|
||||
|
||||
feed('<Cmd>310<CR>dd<Cmd>311<CR>2dd')
|
||||
screen:expect([[
|
||||
{0: }{3:#}{5: Lesson 2.6: OPERATING ON LINES} |
|
||||
{0: } |
|
||||
{0: }{1: Type }{4:dd}{1: to delete a whole line. } |
|
||||
{0: }{1: Type "dd" to delete a whole line. } |
|
||||
{0: } |
|
||||
{0: }Due to the frequency of whole line deletion, the designers of Vi decided |
|
||||
{0: }it would be easier to simply type two d's to delete a line. |
|
||||
{0: } |
|
||||
{0: } 1. Move the cursor to the second line in the phrase below. |
|
||||
{0: } |
|
||||
{0: } 2. Type {2:dd} to delete the line. |
|
||||
{0: } 2. Type dd to delete the line. |
|
||||
{0: } |
|
||||
{0: } 3. Now move to the fourth line. |
|
||||
{0: } |
|
||||
{0: } 4. Type {9:2}{4:dd} to delete two lines. |
|
||||
{0: } 4. Type "2dd" to delete two lines. |
|
||||
{0: } |
|
||||
{7:✓ }{3:1) Roses are red, }|
|
||||
{7:✓ }{3:3) Violets are blue, }|
|
||||
@@ -200,13 +200,13 @@ describe(':Tutor', function()
|
||||
{0: } |
|
||||
{0: }{3:#}{5: Lesson 2.7: THE UNDO COMMAND} |
|
||||
{0: } |
|
||||
{0: }{1: Press }{4:u}{1: to undo the last commands, }{4:U}{1: to fix a whole line. } |
|
||||
{0: }{1: Press "u" to undo the last commands, "U" to fix a whole line. } |
|
||||
{0: } |
|
||||
{0: } 1. Move the cursor to the line below marked {10:✗} and place it on the first error.|
|
||||
{0: } |
|
||||
{0: } 2. Type {4:x} to delete the first unwanted character. |
|
||||
{0: } 2. Type "x" to delete the first unwanted character. |
|
||||
{0: } |
|
||||
{0: } 3. Now type {4:u} to undo the last command executed. |
|
||||
{0: } 3. Now type "u" to undo the last command executed. |
|
||||
{0: } |
|
||||
]])
|
||||
end)
|
||||
@@ -217,14 +217,14 @@ describe(':Tutor', function()
|
||||
screen:expect([[
|
||||
{0: }{3:^#}{5: Lesson 1.3: TEXT EDITING: DELETION} |
|
||||
{0: } |
|
||||
{0: }{1: Press }{4:x}{1: to delete the character under the cursor. } |
|
||||
{0: }{1: Press "x" to delete the character under the cursor. } |
|
||||
{0: } |
|
||||
{0: } 1. Move the cursor to the line below marked {10:✗}. |
|
||||
{0: } |
|
||||
{0: } 2. To fix the errors, move the cursor until it is on top of the |
|
||||
{0: } character to be deleted. |
|
||||
{0: } |
|
||||
{0: } 3. Press {2:the x key} to delete the unwanted character. |
|
||||
{0: } 3. Press the x key to delete the unwanted character. |
|
||||
{0: } |
|
||||
{0: } 4. Repeat steps 2 through 4 until the sentence is correct. |
|
||||
{0: } |
|
||||
@@ -238,7 +238,7 @@ describe(':Tutor', function()
|
||||
{0: } |
|
||||
{0: }{3:#}{5: Lesson 1.4: TEXT EDITING: INSERTION} |
|
||||
{0: } |
|
||||
{0: }{1: Press }{12:i}{1: to insert text. } |
|
||||
{0: }{1: Press "i" to insert text. } |
|
||||
{0: } |
|
||||
{0: } 1. Move the cursor to the first line below marked {10:✗}. |
|
||||
{0: } |
|
||||
@@ -255,14 +255,14 @@ describe(':Tutor', function()
|
||||
screen:expect([[
|
||||
{0: }{3:#}{5: Lesson 1.3: TEXT EDITING: DELETION} |
|
||||
{0: } |
|
||||
{0: }{1: Press }{4:x}{1: to delete the character under the cursor. } |
|
||||
{0: }{1: Press "x" to delete the character under the cursor. } |
|
||||
{0: } |
|
||||
{0: } 1. Move the cursor to the line below marked {10:✗}. |
|
||||
{0: } |
|
||||
{0: } 2. To fix the errors, move the cursor until it is on top of the |
|
||||
{0: } character to be deleted. |
|
||||
{0: } |
|
||||
{0: } 3. Press {2:the x key} to delete the unwanted character. |
|
||||
{0: } 3. Press the x key to delete the unwanted character. |
|
||||
{0: } |
|
||||
{0: } 4. Repeat steps 2 through 4 until the sentence is correct. |
|
||||
{0: } |
|
||||
@@ -276,7 +276,7 @@ describe(':Tutor', function()
|
||||
{0: } |
|
||||
{0: }{3:#}{5: Lesson 1.4: TEXT EDITING: INSERTION} |
|
||||
{0: } |
|
||||
{0: }{1: Press }{12:i}{1: to insert text. } |
|
||||
{0: }{1: Press "i" to insert text. } |
|
||||
{0: } |
|
||||
{0: } 1. Move the cursor to the first line below marked {10:✗}. |
|
||||
{0: } |
|
||||
|
||||
Reference in New Issue
Block a user