Exercises


1.

How can you cause vim to enter Input mode? How can you make vim revert to Command mode?

2.

What is the Work buffer? Name two ways of writing the contents of the Work buffer to the disk.

3.

Suppose that you are editing a file that contains the following paragraph and the cursor is on the second tilde (~):

The vim editor has a command, tilde (~), that changes lowercase letters to uppercase, and vice versa. The ~ command works with a Unit of Measure or a Repeat Factor, so you can change the case of more than one character at a time.


How can you

  1. Move the cursor to the end of the paragraph?

  2. Move the cursor to the beginning of the word Unit?

  3. Change the word character to letter?

4.

While working in vim, with the cursor positioned on the first letter of a word, you give the command x followed by p. Explain what happens.

5.

What are the differences between the following commands?

  1. i and I

  2. a and A

  3. o and O

  4. r and R

  5. u and U

6.

Which command would you use to search backward through the Work buffer for lines that start with the word it?

7.

Which command substitutes all occurrences of the phrase this week with the phrase next week?

8.

Consider the following scenario: You start vim to edit an existing file. You make many changes to the file and then realize that you deleted a critical section of the file early in your editing session. You want to get that section back but do not want to lose all the other changes you made. What would you do?

9.

How can you move the line that the cursor is on to the beginning of the file?

10.

Use vim to create the letter_e file of e's used on page 54. Use as few vim commands as possible. Which vim commands did you use?




A Practical Guide to UNIX[r] for Mac OS[r] X Users
A Practical Guide to UNIX for Mac OS X Users
ISBN: 0131863339
EAN: 2147483647
Year: 2005
Pages: 234

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net