2/3 I'm that fresh out of college sysadmin who uses pico. I posted last
week regarding my manager's comment on newbie sysadmin+pico. I'd like
to learn vi to prove them that I'm a good sysadmin, pico or not. Where
can I find a good vi reference guide and tutorial? Thanks.
\_ The vi book from O'reilly is very good. --sly
\_ If I recall correctly, vi was the very 1st interactive text editor
ever (I don't consider ed to be fully interactive) and, like all
great things, come from Berkeley.
2 modes of operation
\_ The vi book from O'reilly is very good. it'll help you from
- Typing Mode
light fu to advanced fu. --sly
- Special Mode (default)
\_Ugh, don't by an entire book just for that. In a nut shell
2 modes of operation [ plus some obscure ones ]
====================
- Typing Mode [ == "Insert Mode" ]
\_ and hit esc to get back out of typing mode.
- Special Mode (default) [ == "Command Mode" ]
i insert and enter typing mode
a add and enter typing mode
x del char
dd del line
ndd del n lines
nG go to line n
G go to end of file
o add line ahead and enter typing mode
O add line before and enter typing mode
yy yank line
nyy yank n lines
p paste line(s) after dd or yy operation
w skip forward by words
b skup back by words
:w write file (use ! to overide)
:q quit (same w/ !)
:wq write + quit = ZZ
:wfoo write to file foo
cw change word
dw del word
dnw del n words
/{reqexpr} search for a regular expression
\_ if he wants more fu, he will need the ora book.
he could have got your info from man vi --sly
\_ vi really _is_ more than just "a" and "i" and "w".
For instance, there was an article in an old
magazine on how to write self-modifying code in vi
su root -c 'rm -rf /bin/vi ;
macros, and Conway's Game of Life has also been
implemented that way. -- schoen
\_ vi is a toy. Use a real editor:
su root -c 'rm -f /bin/vi ;
cd /bin ;
ln -s ../usr/local/bin/emacs vi'
\_ mr sysadmin, why are you recursively
deleting vi? plus, if you're doing
system administration stuff you
can get things done in a fraction of
the time using vi over emacs. Plus
vi works over a slow modem. Emacs
doesn't
\_ I've run emacs over a 1200 baud
modem. It works great. Using a
single emacs, I can read mail,
read news, surf the web, edit
code and run a shell. Besides,
vi is the visual editor, while
emacs is EDitor macros, and we
all know that ed is the standard
editor.
\_ hjkl for cursor movement |