runtime/tutor: fix typos (#7302)

This commit is contained in:
TJ Rana 2017-09-23 00:07:05 -04:00 committed by Justin M. Keyes
parent 68bc73b107
commit 2e9a345b3e
2 changed files with 168 additions and 166 deletions

View File

@ -23,7 +23,7 @@ relevant help (hopefully), and pressing K over any word will try to do so too.
Sometimes you will be required to modify text like Sometimes you will be required to modify text like
this here this here
Once you have done the changes correctly, the ✗ sign at the left will change Once you have done the changes correctly, the ✗ sign at the left will change
to ✓. I imagine you can already see how neat Vim can be ;) to ✓. I imagine you can already see how neat Vim can be. ;)
Other times, you'll be prompted to run a command (I'll explain this later): Other times, you'll be prompted to run a command (I'll explain this later):
~~~ cmd ~~~ cmd
:help <Enter> :help <Enter>
@ -36,21 +36,21 @@ or press a sequence of keys
Text within <'s and >'s (like `<Enter>`{normal}) describes a key to press instead of text Text within <'s and >'s (like `<Enter>`{normal}) describes a key to press instead of text
to type. to type.
Now, move to the next lesson (remember, use j). Now, move to the next lesson (remember, use the `j`{normal} key to scroll down).
## Lesson 1.1: MOVING THE CURSOR ## Lesson 1.1: MOVING THE CURSOR
** To move the cursor, press the `h`, `j`, `k`, `l` keys as indicated. ** ** To move the cursor, press the `h`, `j`, `k`, `l` keys as indicated. **
k Hint: The h key is at the left and moves left. k Hint: The `h`{normal} key is at the left and moves left.
← h l → The l key is at the right and moves right. ← h l → The `l`{normal} key is at the right and moves right.
j The j key looks like a down arrow. j The `j`{normal} key looks like a down arrow.
1. Move the cursor around the screen until you are comfortable. 1. Move the cursor around the screen until you are comfortable.
2. Hold down the down key (j) until it repeats. 2. Hold down the down key (`j`{normal}) until it repeats.
Now you know how to move to the next lesson. Now you know how to move to the next lesson.
3. Using the down key, move to Lesson 1.2. 3. Using the down key, move to Lesson 1.2.
@ -114,15 +114,15 @@ NOTE: As you go through this tutor, do not try to memorize, learn by usage.
2. To make the first line the same as the second, move the cursor on top 2. To make the first line the same as the second, move the cursor on top
of the first character AFTER where the text is to be inserted. of the first character AFTER where the text is to be inserted.
3. Press i and type in the necessary additions. 3. Press `i`{normal} and type in the necessary additions.
4. As each error is fixed press <Esc> to return to Normal mode. 4. As each error is fixed press `<Esc>`{normal} to return to Normal mode.
Repeat steps 2 through 4 to correct the sentence. Repeat steps 2 through 4 to correct the sentence.
There is text misng this . There is text misng this .
There is some text missing from this line. There is some text missing from this line.
5. When you are comfortable inserting text move to lesson 1.5. 5. When you are comfortable inserting text move to Lesson 1.5.
# Lesson 1.5: TEXT EDITING: APPENDING # Lesson 1.5: TEXT EDITING: APPENDING
@ -133,7 +133,7 @@ There is some text missing from this line.
2. Press [A](A) and type in the necessary additions. 2. Press [A](A) and type in the necessary additions.
3. As the text has been appended press <Esc> to return to Normal mode. 3. As the text has been appended press `<Esc>`{normal} to return to Normal mode.
4. Move the cursor to the second line marked ---> and repeat 4. Move the cursor to the second line marked ---> and repeat
steps 2 and 3 to correct this sentence. steps 2 and 3 to correct this sentence.
@ -143,7 +143,7 @@ There is some text missing from this line.
There is also some text miss There is also some text miss
There is also some text missing here. There is also some text missing here.
5. When you are comfortable appending text move to lesson 1.6. 5. When you are comfortable appending text move to Lesson 1.6.
# Lesson 1.6: EDITING A FILE # Lesson 1.6: EDITING A FILE
@ -151,7 +151,7 @@ There is also some text missing here.
!! NOTE: Before executing any of the steps below, read this entire lesson !! !! NOTE: Before executing any of the steps below, read this entire lesson !!
1. Exit this tutor as you did in lesson 1.2: :q! 1. Exit this tutor as you did in Lesson 1.2: `:q!`{vim}
Or, if you have access to another terminal, do the following there. Or, if you have access to another terminal, do the following there.
2. At the shell prompt type this command: 2. At the shell prompt type this command:
@ -186,14 +186,14 @@ There is also some text missing here.
$ vim FILENAME $ vim FILENAME
~~~ ~~~
3. To exit Vim type: <Esc> :q! <Enter> to trash all changes. 3. To exit Vim type: `<Esc>`{normal} `:q!`{vim} `<Enter>`{normal} to trash all changes.
OR type: <Esc> :wq <Enter> to save the changes. OR type: `<Esc>`{normal} `:wq`{vim} `<Enter>`{normal} to save the changes.
4. To delete the character at the cursor type: `x`{normal} 4. To delete the character at the cursor type: `x`{normal}
5. To insert or append text type: 5. To insert or append text type:
`i`{normal} type inserted text `<Esc>`{normal} insert before the cursor `i`{normal} insert text `<Esc>`{normal} insert before the cursor.
`A`{normal} type appended text `<Esc>`{normal} append after the line `A`{normal} append text `<Esc>`{normal} append after the line.
NOTE: Pressing `<Esc>`{normal} will place you in Normal mode or will cancel NOTE: Pressing `<Esc>`{normal} will place you in Normal mode or will cancel
an unwanted and partially completed command. an unwanted and partially completed command.
@ -220,7 +220,7 @@ There are a some words fun that don't belong paper in this sentence.
** Type `d$`{normal} to delete to the end of the line. ** ** Type `d$`{normal} to delete to the end of the line. **
1. Press <Esc> to make sure you are in Normal mode. 1. Press `<Esc>`{normal} to make sure you are in Normal mode.
2. Move the cursor to the line below marked --->. 2. Move the cursor to the line below marked --->.
@ -287,11 +287,11 @@ insert a count before the motion to delete more:
3. Repeat steps 1 and 2 with a different count to delete the consecutive 3. Repeat steps 1 and 2 with a different count to delete the consecutive
UPPER CASE words with one command UPPER CASE words with one command
this ABC DE line FGHI JK LMN OP of words is Q RS TUV cleaned up. This ABC DE line FGHI JK LMN OP of words is Q RS TUV cleaned up.
# Lesson 2.6: OPERATING ON LINES # Lesson 2.6: OPERATING ON LINES
** Type dd to delete a whole line. ** ** Type `dd`{normal} to delete a whole line. **
Due to the frequency of whole line deletion, the designers of Vi decided Due to the frequency of whole line deletion, the designers of Vi decided
it would be easier to simply type two d's to delete a line. it would be easier to simply type two d's to delete a line.
@ -311,7 +311,7 @@ this ABC DE line FGHI JK LMN OP of words is Q RS TUV cleaned up.
# Lesson 2.7: THE UNDO COMMAND # Lesson 2.7: THE UNDO COMMAND
** Press u to undo the last commands, U to fix a whole line. ** ** Press `u`{normal} to undo the last commands, `U`{normal} to fix a whole line. **
1. Move the cursor to the line below marked ---> and place it on the 1. Move the cursor to the line below marked ---> and place it on the
first error. first error.
@ -319,7 +319,7 @@ this ABC DE line FGHI JK LMN OP of words is Q RS TUV cleaned up.
3. Now type `u`{normal} to undo the last command executed. 3. Now type `u`{normal} to undo the last command executed.
4. This time fix all the errors on the line using the `x`{normal} command. 4. This time fix all the errors on the line using the `x`{normal} command.
5. Now type a capital `U`{normal} to return the line to its original state. 5. Now type a capital `U`{normal} to return the line to its original state.
6. Now type `u`{normal} a few times to undo the U and preceding commands. 6. Now type `u`{normal} a few times to undo the `U`{normal} and preceding commands.
7. Now type `<Ctrl-r>`{normal} a few times to redo the commands (undo the undo's). 7. Now type `<Ctrl-r>`{normal} a few times to redo the commands (undo the undo's).
Fiix the errors oon thhis line and reeplace them witth undo. Fiix the errors oon thhis line and reeplace them witth undo.
@ -350,7 +350,7 @@ Fiix the errors oon thhis line and reeplace them witth undo.
# Lesson 3.1: THE PUT COMMAND # Lesson 3.1: THE PUT COMMAND
** Type p to put previously deleted text after the cursor. ** ** Type `p`{normal} to put previously deleted text after the cursor. **
1. Move the cursor to the first ---> line below. 1. Move the cursor to the first ---> line below.
@ -388,7 +388,7 @@ NOTE: Remember that you should be learning by doing, not memorization.
# Lesson 3.3: THE CHANGE OPERATOR # Lesson 3.3: THE CHANGE OPERATOR
** To change until the end of a word, type `ce`{normal} ** ** To change until the end of a word, type `ce`{normal}. **
1. Move the cursor to the first line below marked --->. 1. Move the cursor to the first line below marked --->.
@ -405,7 +405,7 @@ This line has a few words that need changing using the change operator.
Notice that [c](c)e deletes the word and places you in Insert mode. Notice that [c](c)e deletes the word and places you in Insert mode.
# Lesson 3.4: MORE CHANGES USING c # Lesson 3.4: MORE CHANGES USING `c`{normal}
** The change operator is used with the same motions as delete. ** ** The change operator is used with the same motions as delete. **
@ -422,7 +422,7 @@ Notice that [c](c)e deletes the word and places you in Insert mode.
5. Type `c$`{normal} and type the rest of the line like the second and press `<Esc>`{normal}. 5. Type `c$`{normal} and type the rest of the line like the second and press `<Esc>`{normal}.
The end of this line needs some help to make it like the second. The end of this line needs some help to make it like the second.
The end of this line needs to be corrected using the c$ command. The end of this line needs to be corrected using the `c$`{normal} command.
NOTE: You can use the Backspace key to correct mistakes while typing. NOTE: You can use the Backspace key to correct mistakes while typing.
@ -436,7 +436,7 @@ NOTE: You can use the Backspace key to correct mistakes while typing.
character you want to have there. character you want to have there.
3. The [change operator](c) allows you to change from the cursor to where the 3. The [change operator](c) allows you to change from the cursor to where the
motion takes you. eg. Type `ce`{normal} to change from the cursor to the end of motion takes you. Type `ce`{normal} to change from the cursor to the end of
the word, `c$`{normal} to change to the end of a line. the word, `c$`{normal} to change to the end of a line.
4. The format for change is: 4. The format for change is:
@ -457,7 +457,7 @@ NOTE: Read this entire lesson before executing any of the steps!!
position in the file. Remember the line number for Step 3. position in the file. Remember the line number for Step 3.
NOTE: You may see the cursor position in the lower right corner of the screen NOTE: You may see the cursor position in the lower right corner of the screen
This happens when the ['ruler']('ruler') option is set (see :help 'ruler' ) This happens when the ['ruler']('ruler') option is set (see `:help 'ruler'`{vim} ).
2. Press [G](G) to move you to the bottom of the file. 2. Press [G](G) to move you to the bottom of the file.
Type [gg](gg) to move you to the start of the file. Type [gg](gg) to move you to the start of the file.
@ -472,17 +472,17 @@ NOTE: You may see the cursor position in the lower right corner of the screen
** Type `/`{normal} followed by a phrase to search for the phrase. ** ** Type `/`{normal} followed by a phrase to search for the phrase. **
1. In Normal mode type the `/`{normal} character. Notice that it and the cursor 1. In Normal mode type the `/`{normal} character. Notice that it and the cursor
appear at the bottom of the screen as with the : command. appear at the bottom of the screen as with the `:`{normal} command.
2. Now type 'errroor' `<Enter>`{normal}. This is the word you want to search for. 2. Now type 'errroor' `<Enter>`{normal}. This is the word you want to search for.
3. To search for the same phrase again, simply type [n](n). 3. To search for the same phrase again, simply type [n](n).
To search for the same phrase in the opposite direction, type [N](N). To search for the same phrase in the opposite direction, type [N](N).
4. To search for a phrase in the backward direction, use [?](?) instead of / . 4. To search for a phrase in the backward direction, use [?](?) instead of `/`{normal}.
5. To go back to where you came from press `<Ctrl-o>`{normal} (Keep Ctrl down while 5. To go back to where you came from press `<Ctrl-o>`{normal} (keep `<Ctrl>`{normal} pressed down while
pressing the letter o). Repeat to go back further. `<Ctrl-i>`{normal} goes forward. pressing the letter `o`{normal}). Repeat to go back further. `<Ctrl-i>`{normal} goes forward.
"errroor" is not the way to spell error; errroor is an error. "errroor" is not the way to spell error; errroor is an error.
@ -528,7 +528,7 @@ NOTE: This is very useful in debugging a program with unmatched parentheses!
Adding the g [flag](:s_flags) means to substitute globally in the line, change Adding the g [flag](:s_flags) means to substitute globally in the line, change
all occurrences of "thee" in the line. all occurrences of "thee" in the line.
thee best time to see thee flowers is in thee spring. Usually thee best time to see thee flowers is in thee spring.
4. To change every occurrence of a character string between two lines, type 4. To change every occurrence of a character string between two lines, type
~~~ cmd ~~~ cmd
@ -601,7 +601,7 @@ thee best time to see thee flowers is in thee spring.
NOTE: It is possible to execute any external command this way, also with NOTE: It is possible to execute any external command this way, also with
arguments. arguments.
NOTE: All : commands must be finished by hitting <Enter> NOTE: All `:`{vim} commands must be finished by hitting `<Enter>`{normal}.
From here on we will not always mention it. From here on we will not always mention it.
# Lesson 5.2: MORE ON WRITING FILES # Lesson 5.2: MORE ON WRITING FILES
@ -622,7 +622,7 @@ NOTE: All : commands must be finished by hitting <Enter>
4. This saves the whole file (the Vim Tutor) under the name TEST. 4. This saves the whole file (the Vim Tutor) under the name TEST.
To verify this, type `:!ls`{vim} again to see your directory. To verify this, type `:!ls`{vim} again to see your directory.
NOTE: If you were to exit Vim and start it again with vim TEST , the file NOTE: If you were to exit Vim and start it again with `nvim TEST`, the file
would be an exact copy of the tutor when you saved it. would be an exact copy of the tutor when you saved it.
5. Now remove the file by typing: 5. Now remove the file by typing:
@ -632,7 +632,7 @@ NOTE: If you were to exit Vim and start it again with vim TEST , the file
# Lesson 5.3: SELECTING TEXT TO WRITE # Lesson 5.3: SELECTING TEXT TO WRITE
** To save part of the file, type `v`{normal} motion `:w FILENAME`{vim} ** ** To save part of the file, type `v`{normal} motion `:w FILENAME`{vim}. **
1. Move the cursor to this line. 1. Move the cursor to this line.
@ -665,7 +665,7 @@ NOTE: Pressing [v](v) starts [Visual selection](visual-mode). You can move
# Lesson 5.4: RETRIEVING AND MERGING FILES # Lesson 5.4: RETRIEVING AND MERGING FILES
** To insert the contents of a file, type `:r FILENAME`{vim} ** ** To insert the contents of a file, type `:r FILENAME`{vim}. **
1. Place the cursor just above this line. 1. Place the cursor just above this line.
@ -719,7 +719,7 @@ NOTE: You can also read the output of an external command. For example,
3. Now type some text and press `<Esc>`{normal} to exit Insert mode. 3. Now type some text and press `<Esc>`{normal} to exit Insert mode.
After typing o the cursor is placed on the open line in Insert mode. After typing `o`{normal} the cursor is placed on the open line in Insert mode.
4. To open up a line ABOVE the cursor, simply type a [capital O](O), rather 4. To open up a line ABOVE the cursor, simply type a [capital O](O), rather
than a lowercase `o`{normal}. Try this on the line below. than a lowercase `o`{normal}. Try this on the line below.
@ -734,7 +734,7 @@ Open up a line above this by typing O while the cursor is on this line.
2. Press `e`{normal} until the cursor is on the end of "li". 2. Press `e`{normal} until the cursor is on the end of "li".
3. Type an `a`{normal} (lowercase) to [append](a) text AFTER the cursor. 3. Type the lowercase letter `a`{normal} to [append](a) text AFTER the cursor.
4. Complete the word like the line below it. Press `<Esc>`{normal} to exit Insert 4. Complete the word like the line below it. Press `<Esc>`{normal} to exit Insert
mode. mode.
@ -770,7 +770,7 @@ NOTE: Replace mode is like Insert mode, but every typed character deletes an
# Lesson 6.4: COPY AND PASTE TEXT # Lesson 6.4: COPY AND PASTE TEXT
** Use the `y`{normal} operator to copy text and `p`{normal} to paste it ** ** Use the `y`{normal} operator to copy text and `p`{normal} to paste it. **
1. Go to the line marked with ---> below and place the cursor after "a)". 1. Go to the line marked with ---> below and place the cursor after "a)".
@ -780,19 +780,21 @@ NOTE: Replace mode is like Insert mode, but every typed character deletes an
4. Move the cursor to the end of the next line: `j$`{normal} 4. Move the cursor to the end of the next line: `j$`{normal}
5. Type `p`{normal} to [put](put) (paste) the text. Then type: "a second"`<Esc>`{normal}. 5. Type `p`{normal} to [put](put) (paste) the text.
6. Use Visual mode to select " item.", yank it with `y`{normal}, move to the end of 6. Press `a`{normal} and then type "second". Press `<Esc>`{normal} to leave Insert mode.
7. Use Visual mode to select " item.", yank it with `y`{normal}, move to the end of
the next line with `j$`{normal} and put the text there with `p`{normal}. the next line with `j$`{normal} and put the text there with `p`{normal}.
a) this is the first item. a) This is the first item.
b) b)
NOTE: you can also use `y`{normal} as an operator; `yw`{normal} yanks one word. NOTE: you can also use `y`{normal} as an operator; `yw`{normal} yanks one word.
# Lesson 6.5: SET OPTION # Lesson 6.5: SET OPTION
** Set an option so a search or substitute ignores case ** ** Set an option so a search or substitute ignores case. **
1. Search for 'ignore' by entering: `/ignore` 1. Search for 'ignore' by entering: `/ignore`
Repeat several times by pressing `n`{normal}. Repeat several times by pressing `n`{normal}.
@ -801,7 +803,7 @@ a) this is the first item.
~~~ cmd ~~~ cmd
:set ic :set ic
~~~ ~~~
3. Now search for 'ignore' again by pressing n 3. Now search for 'ignore' again by pressing `n`{normal}.
Notice that Ignore and IGNORE are now also found. Notice that Ignore and IGNORE are now also found.
4. Set the 'hlsearch' and 'incsearch' options: 4. Set the 'hlsearch' and 'incsearch' options:
@ -858,7 +860,7 @@ NOTE: If you want to ignore case for just one search command, use [\c](/\c)
# Lesson 7.1: GETTING HELP # Lesson 7.1: GETTING HELP
** Use the on-line help system ** ** Use the on-line help system. **
Vim has a comprehensive on-line help system. To get started, try one of Vim has a comprehensive on-line help system. To get started, try one of
these three: these three:
@ -881,7 +883,7 @@ You can find help on just about any subject, by giving an argument to the
~~~ ~~~
# Lesson 7.2: CREATE A STARTUP SCRIPT # Lesson 7.2: CREATE A STARTUP SCRIPT
** Enable Vim features ** ** Enable Vim features. **
Vim has many more features than Vi, but most of them are disabled by Vim has many more features than Vi, but most of them are disabled by
default. To start using more features you have to create a "vimrc" file. default. To start using more features you have to create a "vimrc" file.
@ -897,11 +899,11 @@ default. To start using more features you have to create a "vimrc" file.
The next time you start Vim it will use syntax highlighting. The next time you start Vim it will use syntax highlighting.
You can add all your preferred settings to this "vimrc" file. You can add all your preferred settings to this "vimrc" file.
For more information type :help vimrc-intro For more information type `:help vimrc-intro`{vim}.
# Lesson 7.3: COMPLETION # Lesson 7.3: COMPLETION
** Command line completion with `<Ctrl-d>`{normal} and `<Tab>`{normal} ** ** Command line completion with `<Ctrl-d>`{normal} and `<Tab>`{normal}. **
1. Look what files exist in the directory: `:!ls`{vim} 1. Look what files exist in the directory: `:!ls`{vim}
@ -943,14 +945,14 @@ There are many resources online to learn more about vim. Here's a bunch of them:
- *Learn Vim Progressively*: http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/ - *Learn Vim Progressively*: http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/
- *Learning Vim in 2014*: http://benmccormick.org/learning-vim-in-2014/ - *Learning Vim in 2014*: http://benmccormick.org/learning-vim-in-2014/
- Vimcasts: http://vimcasts.org/ - *Vimcasts*: http://vimcasts.org/
- Vim Video-Tutorials by Derek Wyatt: http://derekwyatt.org/vim/tutorials/ - *Vim Video-Tutorials by Derek Wyatt*: http://derekwyatt.org/vim/tutorials/
- *Learn Vimscript the Hard Way*: http://learnvimscriptthehardway.stevelosh.com/ - *Learn Vimscript the Hard Way*: http://learnvimscriptthehardway.stevelosh.com/
- *7 Habits of Effective Text Editing*: http://www.moolenaar.net/habits.html - *7 Habits of Effective Text Editing*: http://www.moolenaar.net/habits.html
- *vim-galore*: https://github.com/mhinz/vim-galore - *vim-galore*: https://github.com/mhinz/vim-galore
If you prefer a book, *Practical Vim* by Drew Neil is recommended often (the sequel, *Modern If you prefer a book, *Practical Vim* by Drew Neil is recommended often (the sequel, *Modern
Vim*, includes material specific to nvim!). Vim*, includes material specific to nvim).
This tutorial was written by Michael C. Pierce and Robert K. Ware, Colorado This tutorial was written by Michael C. Pierce and Robert K. Ware, Colorado
School of Mines using ideas supplied by Charles Smith, Colorado State School of Mines using ideas supplied by Charles Smith, Colorado State

View File

@ -11,7 +11,7 @@
"215": "There are some words that don't belong in this sentence.", "215": "There are some words that don't belong in this sentence.",
"231": "Somebody typed the end of this line twice.", "231": "Somebody typed the end of this line twice.",
"271": -1, "271": -1,
"290": "this line of words is cleaned up.", "290": "This line of words is cleaned up.",
"304": -1, "304": -1,
"305": -1, "305": -1,
"306": -1, "306": -1,
@ -32,14 +32,14 @@
"425": "The end of this line needs to be corrected using the c$ command.", "425": "The end of this line needs to be corrected using the c$ command.",
"487": -1, "487": -1,
"506": -1, "506": -1,
"531": "the best time to see the flowers is in the spring.", "531": "Usually the best time to see the flowers is in the spring.",
"722": -1, "722": -1,
"727": -1, "727": -1,
"744": "This line will allow you to practice appending text to a line.", "744": "This line will allow you to practice appending text to a line.",
"745": "This line will allow you to practice appending text to a line.", "745": "This line will allow you to practice appending text to a line.",
"765": "Adding 123 to 456 gives you 579.", "765": "Adding 123 to 456 gives you 579.",
"766": "Adding 123 to 456 gives you 579.", "766": "Adding 123 to 456 gives you 579.",
"788": "a) this is the first item.", "790": "a) This is the first item.",
"789": " b) this is the second item." "791": " b) This is the second item."
} }
} }