Abbey Workshop

vi Cheat Sheet

Movement
h - left j - down k - up l - right
$ - end of line 0 - Beginning of line
w - forward one word b -- back one word e - end of the current word
Return -- Moves down to the beginning of the next line
^d - down half a screen ^u - up half a screen
^f -- Pages forward one screen ^b -- Pages back one screen
G -- Goes to the last line of the file 1G -- Goes to the first line of the file
:21 -- Goes to line 21 21G -- Goes to line 21

Insert and Delete
x - delete character X - delete previous character
dd - delete line dw - delete word D - delete to eol
i - insert at cursor a - append after cursor A - append at eol
o - open line below O - open line above
:5,10d -- Deletes lines 5 through 10

Searching
/string -- Searches forward for the string ?string -- Searches backward for the string
n -- Finds the next occurrence N -- Finds the previous occurrence
:%s/old/new/g -- Searches and replaces globally

Copy, Move, Manipulate
J - join next line
ayy -- Yanks a copy of line to buffer a
a7yy -- Yanks next 7 lines into buffer a
"ap -- Put the contents of buffer a after cursor
"aP -- Put the contents of buffer a before cursor
:1,3 co 5 -- Copies lines 1 through 3 and puts them after line 5
:4,6 m 8 -- Moves lines 4 through 6 to line 8 (line 6 becomes line 8, line 5 becomes line 7, and line 4 becomes line 6)
:r filename -- Inserts (reads) the file at line after the cursor

Saving and Quitting
:w -- Saves changes (write buffer)
:w new_filename -- Writes buffer to new_filename
:wq -- Saves changes and quits vi
:x -- Saves changes and quits vi
ZZ -- Saves changes and quits vi
:q! -- Quits without saving changes
:wq! -- Saves changes and quits vi (the ! overrides read-only permissions for the owner of the file only)

Set Command Options
:set nu -- Shows line numbers
:set nonu -- Hides line numbers
:set ic -- Instructs searches to ignore case
:set noic -- Instructs searches to be case-sensitive
:set list -- Displays invisible characters, such as tab and end-of-line
:set nolist -- Turns off the display of invisible characters
:set showmode -- Displays current mode of operation
:set noshowmode -- Turns off mode display
:set -- Displays all vi variables set
:set all -- Displays all possible vi variables and their current settings

Google
  Web abbeyworkshop.com   

Copyright © Abbey Workshop 2006

Music Only Search
The Black MP3 Album
The MP3 Album Lyrics
Wprld Music Plus
Mp3 Songs Blog
Music Search Store
First Music Search
Mega MP3 Blog
E MP3 BLog
My MP3 Diary
Fast MP3 Finder
My Blog MP3
Mp3 Songs Mart
My MP3 Songs Album
Top Music Group
Mp3 Tune Records
Song Album Guide
Music DataDite
MP3 Buying Guide
Top MP3 Downloads
MP3 Tune Festival
FAST MP3 Downloads
MP3 Mart Online
Upper MP3
Premium MP3 Site
Music Data online
Fine MP3 Audio
Cheap Music Albums
Fine mp3 downloads
World MP3 Music Records
Mp3 Music Data Direct
The Fine Mp3
MP3 Files World
Home Music Store
DatMP3
Fat MP3 Audio
MP3 ZigZag
MP3 Songs Direct
MP3 Tune World
E MP3 Log
Boom MP3 Music
Speedy MP3
Top 20 MP3 music
Deep MP3 World
Deep MP3 Download
Best-20 MP3
Top Twenty MP3
Deep MP3
Big MP3 Guide
Deep MP3 Audio
Mp3 R.O.B.
MP3-Pop Online
Greate-20-MP3
MP3 Appear
3T-MP3