Qassia Qassia Great Britain
Qassia Global > Qassia Great Britain > Roy Law's Intel > Introduction to vi - Part 1 of 2
Intel Contributor
This intel was added by Roy Law


Roy Law

Intel Classification
This intel has been classified as Existing Authored Content, which means it was authored by the contributor, and first appeared on the contributor's blog or website.

Intel Calendar
December, 2008
1234567
891011121314
15161718192021
22232425262728
293031

January, February, March, April, May, June, July, August, September, October, November, December

Sign Up!
Not a member yet? You're missing out on one of the most powerful website promotion resources on the web. Sign up and join the party.

About Qassia
Find out more about Qassia by reading our About Us page, if you haven't done so already. Or you could skip straight to the Sign Up form.

PRINT THIS INTEL EMAIL THIS INTEL

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 SAVING
Press ESC twice then type q! and press ENTER.

• HOW TO GET OUT WITH SAVING
Press ESC twice then type wq and press ENTER.

• HOW TO GET IN
vi filename

• HOW TO START A NEW FILE
vi newfilename which will start in command mode showing a what looks like a sea of blank lines.

• HOW TO INPUT
i to input at the cursor

• HOW TO DELETE
x to delete character at the cursor

• KEYBOARD MODES
Either command or input; ESC always returns you to command mode but it is not a toggle.


2. KEYBOARD KEYS



• + in command mode
Moves to next line.

• ENTER in command mode
Moves to next line.

• ENTER in input mode
Creates new line.

• SPACE in command mode
Moves to next character.

• BS (BackSPACEE) in command mode
Moves to previous character.

• CTRL--B in command mode
Moves Back one page.

• CTRL—-F in command mode
Moves Forward one page.

• G in command mode
Moves to last line of file.

• u in command mode
Undo previous command.

• . in command mode
Repeat 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.

Images


Copyright Notice: All Rights Reserved.

Add to Facebook Digg Add to Mixx Add to Reddit Add to StumbleUpon
Added by Roy Law on March 27, 11:52 AM.

PLEASE VISIT THE CONTRIBUTOR'S WEBSITE
"I use the LINKS page every day"
"I use the LINKS page every day"
www.SystemsStudio.com

Rate This Intel

Please login or sign up to rate this intel.

Comments

Please login or sign up to add a comment.





Crawled [11/30] - We promised all users participating in the Sticker Mania Promo ...



ABOUT | FAQ | PRESS RELEASES | HELP | CONTACT
USAGE POLICY | PRIVACY POLICY

Copyright 2008 Qassia. All Rights Reserved.

Username:
Password:
No account? Sign up.
Lost password? Retrieve.

In Directory
Education + Training