Lines Matching refs:to

5      Vim is a very powerful editor that has many commands, too many to
6 explain in a tutor such as this. This tutor is designed to describe
7 enough of the commands that you will be able to easily use Vim as
10 The approximate time required to complete the tutor is 30 minutes,
15 file to practice on (if you started "vimtutor" this is already a copy).
17 It is important to remember that this tutor is set up to teach by
18 use. That means that you need to execute the commands to learn them
22 the j key enough times to move the cursor so that lesson 1.1
37 Now you know how to move to the next lesson.
39 3. Using the down key, move to lesson 1.2.
41 NOTE: If you are ever unsure about something you typed, press <ESC> to place
44 NOTE: The cursor keys should also work. But using hjkl you will be able to
45 move around much faster, once you get used to it. Really!
53 1. Press the <ESC> key (to make sure you are in Normal mode).
62 1 through 3 to exit and re-enter the editor.
65 will learn how to save the changes to a file.
67 5. Move the cursor down to lesson 1.3.
74 ** Press x to delete the character under the cursor. **
76 1. Move the cursor to the line below marked --->.
79 character to be deleted.
81 3. Press the x key to delete the unwanted character.
87 5. Now that the line is correct, go on to lesson 1.4.
89 NOTE: As you go through this tutor, do not try to memorize, learn by usage.
97 ** Press i to insert text. **
99 1. Move the cursor to the first line below marked --->.
102 of the character BEFORE which the text is to be inserted.
106 4. As each error is fixed press <ESC> to return to Normal mode.
107 Repeat steps 2 through 4 to correct the sentence.
112 5. When you are comfortable inserting text move to lesson 1.5.
120 ** Press A to append text. **
122 1. Move the cursor to the first line below marked --->.
127 3. As the text has been appended press <ESC> to return to Normal mode.
129 4. Move the cursor to the second line marked ---> and repeat
130 steps 2 and 3 to correct this sentence.
137 5. When you are comfortable appending text move to lesson 1.6.
142 ** Use :wq to save a file and exit. **
146 1. If you have access to another terminal, do the following there.
150 'vim' is the command to start the Vim editor, 'file.txt' is the name of
151 the file you wish to edit. Use the name of a file that you can change.
157 5. If you have quit vimtutor in step 1 restart the vimtutor and move down to
171 3. To exit Vim type: <ESC> :q! <ENTER> to trash all changes.
172 OR type: <ESC> :wq <ENTER> to save the changes.
189 ** Type dw to delete a word. **
191 1. Press <ESC> to make sure you are in Normal mode.
193 2. Move the cursor to the line below marked --->.
195 3. Move the cursor to the beginning of a word that needs to be deleted.
197 4. Type dw to make the word disappear.
200 it. Vim is waiting for you to type w . If you see another character
205 5. Repeat steps 3 and 4 until the sentence is correct and go to lesson 2.2.
212 ** Type d$ to delete to the end of the line. **
214 1. Press <ESC> to make sure you are in Normal mode.
216 2. Move the cursor to the line below marked --->.
218 3. Move the cursor to the end of the correct line (AFTER the first . ).
220 4. Type d$ to delete to the end of the line.
225 5. Move on to lesson 2.3 to understand what is happening.
246 e - to the end of the current word, INCLUDING the last character.
247 $ - to the end of the line, INCLUDING the last character.
249 Thus typing de will delete from the cursor to the end of the word.
260 1. Move the cursor to the start of the line below marked --->.
262 2. Type 2w to move the cursor two words forward.
264 3. Type 3e to move the cursor to the end of the third word forward.
266 4. Type 0 (zero) to move to the start of the line.
272 6. Move on to lesson 2.5.
284 insert a count before the motion to delete more:
287 1. Move the cursor to the first UPPER CASE word in the line marked --->.
289 2. Type d2w to delete the two UPPER CASE words.
291 3. Repeat steps 1 and 2 with a different count to delete the consecutive
304 ** Type dd to delete a whole line. **
306 Due to the frequency of whole line deletion, the designers of Vi decided
307 it would be easier to simply type two d's to delete a line.
309 1. Move the cursor to the second line in the phrase below.
310 2. Type dd to delete the line.
311 3. Now move to the fourth line.
312 4. Type 2dd to delete two lines.
322 Doubling to operate on a line also works for operators mentioned below.
328 ** Press u to undo the last commands, U to fix a whole line. **
330 1. Move the cursor to the line below marked ---> and place it on the
332 2. Type x to delete the first unwanted character.
333 3. Now type u to undo the last command executed.
335 5. Now type a capital U to return the line to its original state.
336 6. Now type u a few times to undo the U and preceding commands.
338 to redo the commands (undo the undo's).
342 8. These are very useful commands. Now move on to the lesson 2 Summary.
350 1. To delete from the cursor up to the next word type: dw
351 2. To delete from the cursor up to the end of the word type: de
352 3. To delete from the cursor to the end of a line type: d$
359 operator - is what to do, such as d for delete
360 [number] - is an optional count to repeat the motion
361 motion - moves over the text to operate on, such as w (word),
364 7. To move to the start of the line use a zero: 0
374 ** Type p to put previously deleted text after the cursor. **
376 1. Move the cursor to the first line below marked --->.
378 2. Type dd to delete the line and store it in a Vim register.
380 3. Move the cursor to the c) line, ABOVE where the deleted line should go.
382 4. Type p to put the line below the cursor.
384 5. Repeat steps 2 through 4 to put all the lines in correct order.
397 ** Type rx to replace the character at the cursor with x . **
399 1. Move the cursor to the first line below marked --->.
405 4. Repeat steps 2 and 3 until the first line is equal to the second one.
410 5. Now move on to lesson 3.3.
422 1. Move the cursor to the first line below marked --->.
428 4. Press <ESC> and move to the next character that needs to be changed.
451 3. Move the cursor to the first line below marked --->.
453 4. Move the cursor to the first error.
457 ---> The end of this line needs some help to make it like the second.
458 ---> The end of this line needs to be corrected using the c$ command.
460 NOTE: You can use the Backspace key to correct mistakes while typing.
471 character you want to have there.
473 3. The change operator allows you to change from the cursor to where the
474 motion takes you. eg. Type ce to change from the cursor to the end of
475 the word, c$ to change to the end of a line.
481 Now go on to the next lesson.
488 ** Type CTRL-G to show your location in the file and the file status.
489 Type G to move to a line in the file. **
500 2. Press G to move you to the bottom of the file.
501 Type gg to move you to the start of the file.
504 return you to the line you were on when you first pressed CTRL-G.
506 4. If you feel confident to do this, execute steps 1 through 3.
512 ** Type / followed by a phrase to search for the phrase. **
517 2. Now type 'errroor' <ENTER>. This is the word you want to search for.
524 5. To go back to where you came from press CTRL-O (Keep Ctrl down while
525 pressing the letter o). Repeat to go back further. CTRL-I goes forward.
527 ---> "errroor" is not the way to spell error; errroor is an error.
535 ** Type % to find a matching ),], or } . **
541 3. The cursor will move to the matching parenthesis or bracket.
543 4. Type % to move the cursor to the other matching bracket.
545 5. Move the cursor to another (,),[,],{ or } and see what % does.
558 ** Type :s/old/new/g to substitute 'new' for 'old'. **
560 1. Move the cursor to the line below marked --->.
565 3. Now type :s/thee/the/g . Adding the g flag means to substitute
568 ---> thee best time to see thee flowers is in thee spring.
572 of lines where the substitution is to be done.
573 Type :%s/old/new/g to change every occurrence in the whole file.
574 Type :%s/old/new/gc to find every occurrence in the whole file,
575 with a prompt whether to substitute or not.
582 G moves to the end of the file.
583 number G moves to that line number.
584 gg moves to the first line.
588 After a search type n to find the next occurrence in the same direction
589 or N to search in the opposite direction.
590 CTRL-O takes you back to older positions, CTRL-I to newer positions.
592 3. Typing % while the cursor is on a (,),[,],{, or } goes to its match.
604 ** Type :! followed by an external command to execute that command. **
606 1. Type the familiar command : to set the cursor at the bottom of the
607 screen. This allows you to enter a command-line command.
609 2. Now type the ! (exclamation point) character. This allows you to
616 NOTE: It is possible to execute any external command this way, also with
627 ** To save the changes made to the text, type :w FILENAME **
629 1. Type :!dir or :!ls to get a listing of your directory.
637 To verify this, type :!dir or :!ls again to see your directory.
639 NOTE: If you were to exit Vim and start it again with vim TEST , the file
652 1. Move the cursor to this line.
654 2. Press v and move the cursor to the fifth item below. Notice that the
662 5. Vim will write the selected lines to the file TEST. Use :!dir or :!ls
663 to see it. Do not remove it yet! We will use it in the next lesson.
666 to make the selection bigger or smaller. Then you can use an operator
667 to do something with the text. For example, d deletes the text.
678 DOWN to see this lesson again.
703 2. :w FILENAME writes the current Vim file to disk with name FILENAME.
719 ** Type o to open a line below the cursor and place you in Insert mode. **
721 1. Move the cursor to the first line below marked --->.
723 2. Type the lowercase letter o to open up a line BELOW the cursor and place
726 3. Now type some text and press <ESC> to exit Insert mode.
742 ** Type a to insert text AFTER the cursor. **
744 1. Move the cursor to the start of the first line below marked --->.
748 3. Type an a (lowercase) to append text AFTER the cursor.
750 4. Complete the word like the line below it. Press <ESC> to exit Insert
753 5. Use e to move to the next incomplete word and repeat steps 3 and 4.
755 ---> This li will allow you to pract appendi text to a line.
756 ---> This line will allow you to practice appending text to a line.
758 NOTE: a, i and A all go to the same Insert mode, the only difference is where
765 ** Type a capital R to replace more than one character. **
767 1. Move the cursor to the first line below marked --->. Move the cursor to
773 3. Press <ESC> to leave Replace mode. Notice that the rest of the line
776 4. Repeat the steps to replace the remaining xxx.
778 ---> Adding 123 to xxx gives you xxx.
779 ---> Adding 123 to 456 gives you 579.
788 ** Use the y operator to copy text and p to paste it **
790 1. Move to the line below marked ---> and place the cursor after "a)".
792 2. Start Visual mode with v and move the cursor to just before "first".
794 3. Type y to yank (copy) the highlighted text.
796 4. Move the cursor to the end of the next line: j$
798 5. Type p to put (paste) the text. Then type: a second <ESC> .
800 6. Use Visual mode to select " item.", yank it with y , move to the end of
829 NOTE: If you want to ignore case for just one search command, use \c
834 1. Type o to open a line BELOW the cursor and start Insert mode.
835 Type O to open a line ABOVE the cursor.
837 2. Type a to insert text AFTER the cursor.
838 Type A to insert text after the end of the line.
840 3. The e command moves to the end of a word.
852 7. Prepend "no" to switch an option off: :set noic
866 Read the text in the help window to find out how the help works.
867 Type CTRL-W CTRL-W to jump from one window to another.
868 Type :q <ENTER> to close the help window.
870 You can find help on just about any subject, by giving an argument to the
897 You can add all your preferred settings to this "vimrc" file.
914 5. Type d<TAB> and Vim will complete the command name to ":edit".
927 1. Type :help or press <F1> or <HELP> to open a help window.
929 2. Type :help cmd to find help on cmd .
931 3. Type CTRL-W CTRL-W to jump to another window.
933 4. Type :q to close the help window.
935 5. Create a vimrc startup script to keep your preferred settings.
937 6. When typing a : command, press CTRL-D to see possible completions.
938 Press <TAB> to use one completion.
948 This concludes the Vim Tutor. It was intended to give a brief overview of
949 the Vim editor, just enough to allow you to use the editor fairly easily.
956 The first book completely dedicated to Vim. Especially useful for beginners.
963 It is a good book to get to know almost anything you want to do with Vi.