Workshop

The Workshop summarizes the key terms you learned and poses some questions about the topics presented in this chapter. It also provides you with a preview of what you will learn in the next hour.

Key Terms

colon commands The vicommands that begin with a colon, usually used for file manipulation.

escape sequence An unprintable sequence of characters that usually specifies that your terminal take a specific action, such as clearing the screen.

replace mode A mode of vi in which any characters you type replace those already in the file.

Exercises

1:What does the following command do?
:1,5 s/kitten/puppy

2:What do these commands do?
15i?ESCh
i15?ESCh
i?ESC15h

3:What would happen if you were to use the following startup flags?
vi +O test
vi +/joe/ names
vi +hhjjhh
vi +:q testme

4:Try ^g on the first and last lines of a file. Explain why the percentage indicator might not be what you expected.
5:What's the difference between the following four strings?
rr
RrESC
cwrESC
CrESC

6:What key mappings do you have in your version of vi? Do you have labeled keys on your keyboard that could be helpful in vi but aren't defined? If so, define them in your .exrc file using the :map command.
7:What do you think the following command will do? Try it and see whether you're right.
!} ls

Preview of the Next Hour

With this hour and the preceding one, you now know more about vi than the vast majority of people using UNIX today. There's a second popular editor, however, one that is modeless and offers its own interesting possibilities for working with files and the UNIX system. It's called emacs, and if you have it on your system, it's definitely worth a look. In the next hour, you learn about this editor and some of the basics of using it.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.135.224