|
    |
|
|
Introduction to vi - Part 1 of 2
All computers need operating systems, all operating systems use scripts (user-written sets of instructions), all scripts need editors. vi is the default editor for UNIX (one of the greatest operating systems of all time). The name derives from visual editor, which is not such as contradiction as it seems since early computer editors worked on a single line or worse. Single-handledly it has been regarded as responsible for the majority of nervous breakdowns amongst those learning UNIX because [1] in vi it is vital to remember that the keyboard can be in one of two modes, yet there is no visual indication of this! [2] in vi most of the special keys (including arrows) won't work! [3] in vi there is no visual indication of which file you are editing! However, you do have a new best friend and the cursor movements rapidly become natural without adversely affecting any other aspect of your life. 1. BASICS • YOUR BEST FRIEND is the escape key ESC. • HOW TO GET OUT WITHOUT SAVINGPress ESC twice then type q! and press ENTER. • HOW TO GET OUT WITH SAVINGPress ESC twice then type wq and press ENTER. • HOW TO GET INvi filename • HOW TO START A NEW FILEvi newfilename which will start in command mode showing a what looks like a sea of blank lines. • HOW TO INPUTi to input at the cursor • HOW TO DELETEx to delete character at the cursor • KEYBOARD MODESEither command or input; ESC always returns you to command mode but it is not a toggle. 2. KEYBOARD KEYS • + in command modeMoves to next line. • ENTER in command modeMoves to next line. • ENTER in input modeCreates new line. • SPACE in command modeMoves to next character. • BS (BackSPACEE) in command modeMoves to previous character. • CTRL--B in command modeMoves Back one page. • CTRL—-F in command modeMoves Forward one page. • G in command modeMoves to last line of file. • u in command modeUndo previous command. • . in command modeRepeat previous command. 3. PRACTICE • THE BEST PRACTICE ... IS FOR REAL. • HOWEVER, get a copy of the daphne file (see Appendix) into your home directory and use that for practice. • EXTEND YOUR KNOWLEDGE from the GLOSSARY in Part 2. • ALWAYS check which directory you are in. APPENDIX - the daphne file This should be a small, plain, vanilla-flavoured, text (ASCII) file; it is believed to have been named after the very first air hostess (Daphne Vickers) - I first encountered it through the guy who taught me vi (Andrew Whitechapel). Hello I am the daphne file I am very small and insignificant I am even smaller than an asterisk * I'd like to be bigger I'm sleepy now Goodnight little daphne Goodnight all! (C) 1992/1999, Roy Law.
|
PLEASE VISIT THE CONTRIBUTOR'S WEBSITE
No reactions yet.
Please login or sign up to rate this intel.
Please login or sign up to add a comment.
The copyright for this content entitled "Introduction to vi - Part 1 of 2" has been specified by the contributor as:
All Rights Reserved
This content may not be copied, distributed or adapted by anyone under any circumstances.
|
 |
|
This intel was contributed by Roy Law

Roy Law
|
May, 2012
2008
January, February, March, April, May, June, July, August, September, October, November, December
2009
January, February, March, April, May, June, July, August, September, October, November, December
2010
January, February, March, April, May, June, July, August, September, October, November, December
2011
January, February, March, April, May, June, July, August, September, October, November, December
2012
January, February, March, April, May
|
|
Not a member yet?
Qondio is a powerful network for making it online. If you have a website to
promote, we can help.
Sign up and get in on the action.
|
|
Welcome to Qondio! Discover the awesome power this network can deliver by going to our About page. Or you could skip straight to the Sign Up form.
|
|