Vim

Multiple windows
ctags
Command line options
Mapping keystrokes

What is vim?

An excellent text editor.

How can I effectively use vim?

I need to complete this part.

How can I read the help file for a particular feature?

:help featureName

What are the available modes?

  1. Command Mode: You type command without using the colon. From insert mode, to get back to command mode, press the escape key.
  2. Ex Mode
  3. Insert Mode

When you starts vim, it is in command mode. This is the mode where you can execute vim commands (commands that do not start with a colon). Before you can type text into your document, you must switch to the insert mode by typing the lowercase letter i. From the insert mode, to get back to command mode, press the escape key.

The Ex Mode is another mode where you can enter commands. These commands are known as Ex commands. To enter an Ex command, from command mode, press the colon key.

How does vim handle delete buffers?

Vi saves the last nine deletions in nine numbered deletion buffers. This works only for deleted line. Words, or portion of line, are not saved into a buffer. If you want to restore a deleted word or line fragment and u won't work, use p command by itself. This restore whatever you've last deleted. You can search through the numbered buffers: "1pu.u.u etc

How does vim handle yank buffers?

Vim use the same buffers for yanking (copying) as deleting. Up to nine previous yanks or deletions can be recalled with the put / paste command. You can also yank or delete into 26 named buffers.

How can I display control characters?

:%l             // show all control character

How can I run an external shell command?

:!command       // run and external shell command 
:!rm junkfile   // execute shell command rm to remove junkfile
:!df            // execute shell command df to check disk free space
CTRL+Z          // suspend vi, return to the shell (type fg to return to vi)

How can I run an external shell command and capture its output?

:r !command     // reads the result of the shell command  into the current file below the current line 
:r !date        // execute unix command 'date' and read the result into your file.
:r !sort phone  // read the content of phone after it has been passed through the sort filter.

How can I spawn a shell?

:!sh     // spawn a shell 
:!sh             // get to the shell (CTRL+D or exit to terminate the shell and return to vi)

How can I list the current directory?

:!ls     // list the current directory

How can I do search and replace?

:%s/t/x/g       // search and replace the whole file 
:.,$s/t/x/g     // search and replace from the current line to end of file 
:s/old/new/        // Change the first occurrence of the pattern 'old' to 'new' on the current line.
:s/old/new/g       // Change every occurrence of the pattern 'old' to 'new' on the current line, not just the first occurrence.
50,100s/old/new/g  // For line 50 to line 100, change every occurrence of 'old' to 'new'
1,$s/old/new/g     // For every line in the file, change all occurrence of 'old' to 'new'
%s/old/new/g       // For every line in the file, change all occurrence of 'old' to 'new'
%s/old/new/gc      // Same as above, but ask for confirmation.  If you want to make the replace, you must enter y (for yes) 
                   // and press RETURN.  If you don't want to make the replacement, simply press RETURN.  The combination of 
                   // n (repeat last search) and dot (.) (repeat last command) is also extraordinarily useful and quick way 
                   // to page through a file and make repetitive changes that you may not want to make globally.
%&g                // Repeat last substitution everywhere.
:s//~/             // Repeat the last substitution
:s                 // Same as :s//~/ (repeat last substitution)
:&                 // Repeat last substitution (same as :s)
&                  // Repeat last substitution (same as :s)

:g/pattern/s/old/new/g    // The first g tells the command to operate on all lines.  pattern identifies the lines on which a 
                          // substitution is to take place.  The last g indicates that the substitution is to occur globally
                          // on selected lines.  This is known as context-sensitive replacement.  
:g/pattern/s//new/g       // If the pattern being used to find the line is the same as the one you want to change, you don't have
                          // to repeat it (same as :g/old/s/old/new/g)
:g/editer/s//editor/g     // Same as :%s/editer/editor/g

How can I quickly move lines of text?

:g/^https/m$  // Move all lines starting with https to the end of file
:g/^https/m0  // Move all lines starting with https to the start of file
:20,.m$                   // move line 20 through the current line to the end of file
z RETURN   // move current line to top of screen
z.         // move current line to center of screen
z-         // move current line to bottom of screen
200z RETURN // move line 200 to top of screen
:g/.*/mo0         // reverse the lines in a file
:g/^/mo0          // reverse the lines in a file

You can also move blocks of text delimited by patterns. For example, assume that you have a 150-page reference manual. Each page is

organized into three paragraphs with the same three headings: SYNTAX, DESCRIPTION, and PARAMETERS. Suppose that you need to move
DESCRIPTION above the SYNTAX paragraph. With pattern matching, you can move blocks of text on all 150 pages with one command:

:g /SYNTAX/.,/DESCRIPTION/-1 move /PARAMETERS/-1

This command works as follows. First, ex finds and marks each line that matches the first pattern (contains the word SYNTAX). Second,

for each marked line, it sets . (dot, the current line) to that line, and executes the command. Using the move command, the command
moves the block of lines from the current line (dot) to the line before the one containing the word DESCRIPTION to just before the line
containing PARAMETERS.

How can I quickly delete text?

:v/warning/d    // delete all lines not matching a pattern 
d%              // delete until matching paran 
dd       // delete lines
dw       // delete words
dd       // delete line
D        // delete to the end of line
dG       // delete all lines from cursor to the end of file
d8G      // delete all lines from cursor to line 8
:.,$d                     // delete from current line to end of file
:%d                       // delete all lines
:/pattern/d               // delete the next line containing pattern
:/pattern1/,/pattern2/d   // delete from the first line containing pattern1 through the first line containing pattern2
d/pattern // delete from cursor until the next occurrence of pattern
d?pattern // delete from cursor until the last occurrence of pattern
dfa      // delete upto and including next character 'a'
d2fa     // delete upto and including the second occurrence of character 'a'
dta      // delete upto but including next character 'a'
x        // delete the character below the cursor
S          // delete entire line and switch to insert mode
s          // delete one character and switch to insert mode

dw         // delete word
d2w        // delete two words
dd         // delete line
D          // delete from cursor position to end of line
d/pattern  // delete from cursor position to matching pattern
dfx        // delete from cursor position to next occurrence of character x

x          // delete the character the the cursor is on
5x         // delete 5 characters

"a6dd    // delete 6 lines and put them in buffer 'a'
"AdG     // delete from cursor to the end of file and put it in buffer A

CTRL+W   // delete word before the cursor (in insert mode)
CTRL+U   // delete all inserted characters in the current line

Block definition by patterns can also be used with other ex commands. For example, if you want to delete all DESCRIPTION paragraphs in the reference chapter, you could enter:

:g/DESCRIPTION/,/PARAMETERS/-1d

This very powerful kind of change is implicit in ex's line addressing syntax, but it is not readily apparent even to experienced users.

For this reason, whenever you are faced with a complex, repetitive editing task, take time to analyze the problem and find out if you
can apply pattern matching tools to get the job done.

:g/^$/d           // delete all blank lines
:g/^[ tab]*$/d    // delete all blank lines and any lines that contains only whitespaces

How can I quickly change case?

g~2w     // switch case for the next 2 words
gu2w     // lowercase the next 2 words
gU2w     // uppercase the next 2 words
viwU  //convert word under the cursor to upper case 
viwu   //convert word under the cursor to lower case 
viw~  // flip case for the word under the cursor 
~ // flip case for the character under the cursor 
villl~ //flip case for a block of text 
~                               // flip the case of selected text
:%s/.*/\U&/       // change every word in a file to uppercase
:%s/./\U&/g       // change every word in a file to uppercase (but significantly slower than above)

How can I quickly change text?

cc       // changes lines
cw       // change word
cc       // change the current line
cfx      // change until the next occurrence of 'x'
C        // change until the end of line
c/pattern // change until the next occurrence of pattern

xp        // swap characters
dwwP      // swap words
ddp       // swap lines
dwep       // transpose two words

cw         // change word (delete to end of word, and switch to insert mode)
c2b        // delete 2 words to the left, and switch to insert mode
c$         // delete to the end of line and switch to insert mode
c0         // delete to the start of line and switch to insert mode
cc         // delete entire line and switch to insert mode
C          // delete to end of line and switch to insert mode
ct.        // delete up to, not including the period, and switch to insert mode

50i*ESC  // insert 50 stars (*) where you are
20I-ESC  // insert 20 hyphen at the beginning of line
10a#ESC  // append 10 #'s after the next character
20A#ESC  // append 20 #'s at the end of line
25a*-ESC   // insert 50 characters (25 pairs of asterisk and hyphen)
25r-       // replace 25 characters with 25 hyphens

2 CTRL+A // add 2 to the number under the cursor (command mode)
2 CTRL+X // substract 2 to the number under the cursor (command mode)

:1,10g/^/ 12,17t$                                 // place 10 copies of lines 12 through 17 at the end of your current file

'Change' is a shortcut for quickly deleting text and then immediately switch to insert mode?

How can I do copy and paste?

:1,20y          // yank (copy) lines 1 through 20 into the default buffer 
:1,20ya         // yank lines 1 through 20 and put them in buffer 'a' 
yw       // yank word
y8w      // yank 8 words
Y        // yank line
8Y       // yank 8 lines
y/pattern // yank from cursor up to but not including pattern
yw         // yank (copy) word
y$         // yank (copy) from cursor position to end of line
yy         // yank (copy) entire line
4yy        // yank (copy) 4 lines
Y          // yank (copy) the whole line
"dyy       // yank (copy) the whole line into named buffer d
"dp        // paste the content of buffer d
"Dyw       // yank word and append it to buffer d

p        // put the content of the default buffer after/below the cursor
2p       // paste from delete buffer number 2
"aY      // yank line into named buffer 'a'
"ap      // put the content of buffer 'a' after/below cursor
"3p        // put the content of buffer number 3 on the line below the cursor

]p       // paste with indentation adjusted
[p       // like P with indentation adjusted
p          // paste (put the text that is in the buffer after the cursor)
P          // paste (put the text that is in the buffer before the cursor)
gp       // like p, leaving the cursor after new text
gP       // like P, leaving the cursor after new text

CTRL+R bufferName // paste (this is an insert mode command)
CTRL+Rx  // insert the content of register x (this is an insert mode command)

How can I save the current buffer to disk?

:w              // save the current buffer to disk

How can I save the current buffer to a new file?

:w newfilename  // save to a new file

How can I save line 10 through line 50 to a new file?

:10,50w newfilename  // save lines 10 through 50 to a new file

How can I save from the current line through the end of file to a new file?

:.,$w! filename      // save from the current line through end of file to a new file

How can I save from two lines below the current line through the end of file to a new file?

:.+2,'aw filename    // save from two lines  down from current line through marker 'a' to a new file

How can I save lines between 2 patterns to a new file?

:/pattern1/,/pattern2/w filename  // save lines between two patterns to a file

How can I append the current buffer to an existing file?

:w >>filename        // append the current buffer to a file

How can I save the current file with a .new extension?

:w %.new    // save the current file with a .new extension

How can I append a block of lines to a file?

:/pattern1/,/pattern2/g /^Chapter/ .+2w >> begin  // restrict lines selected by g, then send the second line below line starting with 
                                                  // Chapter to a file named begin.

How can I open a file?

:e filename    // open filename 
:e! filename   // edit filename, discarding the current buffer 
:new filename  // open filename
:e!               // discard change

How can I open the file under the cursor?

gf       // load a file whose name is under the cursor 
Ctrl+W f // load a file whose name is under the cursor (this is an insert mode command)

How can I open the previous file?

:e#             // open previous file 
:e! #       // discard change in current file and load alternate file
CTRL+^      // same as :e #

What is an alternate file?

vi remembers two filenames at a time as the current (%) and alternate filenames (#). # is particularly useful with :e since it allows

you to switch easily back and forth between two files.

How can I open the next file?

:n                // load the next file

How can I change the name of the current file being edited?

:f filename  // change the name of the current file being edited

How can I read the content of an existing file into the current buffer below the current line?

:r filename  // reads the content of filename into current buffer below the current line

How can I read-in file at the end of current file?

:$r filename      // Place the read-in file at the end of current file

How can I place the read-in file at the very beginning of current file?

:0r filename      // Place the read-in file at the very beginning of current file

How can I exit (quit) vim?

:q       // quit out of vi 
:q!      // quit out of vi without saving changes 
:wq      // save and quit 
:x       // save and quit 
ZZ                // save and quit

How can I set various settings?

You can change options from within vi by using the ':set' command. In addition, whenever vi is started up, it reads a file in your home directory called .exrc for further instructions. By placing ':set' commands in this file, you can modify the way vi acts whenever you use it. You can also set up .exrc files in local directories to initialize various options that you want to use in different environments. The .exrc file in your home directory will be executed first, then the one in your current directory. Finally, any commands stored in the shell variable EXINIT will be executed by vi on startup. The settings in EXINIT take precedence over those in home directory .exrc file.

:set nu    // display line number 
:set nonu  // hide line number 
:set sm    // show matching brace or parentheses while inserting 
:set ignorecase  // set ignore-case search 
:set icsearch    // set ignore-case search 
:set smartcase   // automatically switch to a case-sensitive search if you use any capital letters 
:set hlsearch    // highlight search result 
:colo evening    // change the foreground color 
:set showmatch        // show matching paren as you type
:set list // identify true space (tab is displayed as ^I, end of line is displayed as $ )
:set dictionary=/usr/share/dict/words
:set nu       // display line number
:set nonu     // turn off display line number
:set ic       // turn on ignore-case (make search case insensative)
:set noic     // turn off ignore-case (make search case sensative)
:set all      // displays the complete list of options
:set          // displays the options that you have specifically changed, or set, either in your .exrc file or during current session.
:set nu?      // display the current value

ignorecase    // when set, make search case insensitive (off by default)
wrapmargin    // specifies the size of the right margin that will be used to autowrap text as you type
              // (essential for editing non-program text)
wrapscan      // when search reach the end of file, n will wrap to the top of file (on by default)
magic         // recognize wild card characters when pattern matching (on by default)
autoindent
shiftwidth=4
:set list          // equivalent with :l, show control characters
showmatch          // show matching brackets as you type
:set tagstack      // support tag stacking
:set notagstack    // disable tag stacking
:set tags=tags     // set the name of the tag file
:set tagpath=/usr/lib/tags     // set the path for the tag file

:set hidden        // for multiwindow editing
:set splitbelow    // for multiwindow editing
:set equalalways   // ...
:set winheight     // ...
:set cmdheight     // ...

:set undolevels
:set binary
:set incsearch
:set hlsearch     // highlight search result

fileformat        // set the file format.  This is an easy way to convert between Linux and MS-DOS files and vice versa.

autoindent        // simple-minded indentation, uses that of the previous line.
smartindent       // similar to autoindent, but knows a little about C syntax.  Deprecated in favor of cindent.
cindent           // enables automatic indenting for C programs, and is quite smart.
cinkeys           // input keys that trigger indentation options.
cinoptions        // allows you to tailor your preferred indentation style
cinwords          // keywords that start an extra indentation on the following line.
formatoptions     // Made up of a number of single letter flags that control several behaviors, notably how comments are formatted as 
                  // you type them.
comments          // Describes different formatting options for different kinds of comments, both those with starting and ending
                  // delimiters, as in C, and those that start with single symbol and go to the end of the line, such as in
                  // a Makefile or shell program.

Since the .exrc file is read by ex before it enters visual mode (vi), commands in .exrc file need not have a preceding colon.

In all modern versions of vi, you have to first set the exrc option in you home directory .exrc file before vi will read the .exrc file in the current directory: 'set exrc'. This mechanism prevents other people from placing, in your working directory, an .exrc file whose commands might jeopardize the security of your system.

These commands typically should be stored in your ~/.vimrc file.

How can I display content of all registers?

:reg     // show the content of all registers

How can I display the content of register x?

:reg x   // show the content of register x

How can I delete line 2 through line 5 but store those lines into register x?

:1,2dx   // delete range into register x

How can I repeat the last command?

.        // repeat last command

How can I undo the last command?

u        // undo last command 
U          // restore the line to its pristine state, the way it was before any changes were applied to it.

How can I replace character below cursor with single character 'x'?

rx       // replace character below cursor with single character 'x'

How can I replace the next four characters with a single character 'x'?

4rx      // replace next four characters with single character 'x'

How can I display filename, line, and column information?

Ctrl+G   // (command mode) display filename, line, and column

How can I substitute next 3 characters and go into insert mode?

3s       // substitute next 3 characters and go into insert mode

How can I substitute next 3 lines, and go into insert mode?

3S       // substitute next 3 lines, and go into insert mode

What are some quick movement commands?

%        // find matching paran 
'0       // (single quote followed by zero) take you to place you last edited 
0        // (zero) jump to the start of line (column zero) 
^        // jump to the start of line (first non-whitespace) 
$        // jump to the end of line 
fx         // move the cursor to the next instance of character x
Fx         // move the cursor to the previous occurrence of character x in the line
tx         // move the cursor to the character before the next occurrence of character x in the line
Tx         // move the cursor to the character after previous occurrence of x in the line
;        // repeat last find of character
,        // repeat last find of character in reverse
;          // repeat previous inline search in the same direction
,          // repeat previous inline search in opposite direction
gg       // go to beginning of file
G        // jump to the end of file
1G       // jump to the start of file
8G       // jump to line 8th in the file
3w       // jump forward 3 words
3W       // jump forward 3 words, ignore punctuation
2b       // jump backward 2 words
2B       // jump backward 2 words, ignore punctuation
e        // jump to the end of current word
7e       // jump to the end of the seventh word
E        // jump to the end of word, ignore punctuation
6E       // jump to the end of sixth word, ignore punctuation
2fa      // jump to the second occurrence of character 'a' (forward)
2Fa      // jump to the second occurrence of character 'a' (backward)
2ta      // jump to the second occurrence of character 'a' (not including character 'a')
*        // this search command will find the next occurrence of the word the cursor is currently on
/pattern // locate next occurrence of pattern
?pattern // locate last occurrence of pattern
n        // go to next occurrence of pattern (after using / or ?)
N        // go to last occurrence of pattern (after using / or ?)
g*       // search for partial word under the cursor (repeat with n)
gm       // go to middle of line
M        // go to middle line of window
`[ and `]  // move to either end of the chunk of text most recently modified
`<       // move to the start of most recent selection
`>       // move to the end of most recent selection

'x       // go to the start of the line containing the marker
`x       // go to marker x
'x         // (apostrophe) move the cursor to the first character of the line marked by x
`x         // (back quote) move the cursor to the character marked by x
``         // move to  the exact position of the previous mark or context after a move (see elsewhere on this page for more info)
''         // (apostrophes) move to the beginning of the line of the previous mark or context (see elsewhere on this page for more info)

h          // move left one character
j          // move down one line
k          // move up one line
l          // move right one character

w          // move forward one word (symbols and punctuation are equivalent to word)
W          // move forward one word (symbols and punctuation are not considered as word)
b          // move backward one word
B          // move backward one word
2k         // move up 2 lines
0          // move to beginning of line
^          // move to the first non-blank character of current line
$          // move to end of line
n|         // move to column n of current line

8|       // jump to the 8th column
8(       // jump back 8 sentences
8)       // jump forward 8 sentences
8{       // jump back 8 paragraphs
8}       // jump forward 8 paragraphs
)        // jump to the start of next sentence
(        // jump to the start of last sentence

Ctrl+O   // jump back to where you were (this is an insert mode command)
Ctrl+I   // Ctrl+O and Ctrl+I take you up and down the list of recent positions (this is an insert mode command)

CTRL+X CTRL+E // scroll up (this is an insert mode command)
CTRL+X CTRL+Y // scroll down (this is an insert mode command)

CTRL+F     // scroll forward one screen
CTRL+B     // scroll backward one screen
CTRL+D     // scroll forward half screen
CTRL+U     // scroll backward half screen

H          // move to home (top line of screen)
M          // move to middle line of screen
L          // move to last line of screen
nH         // move to n lines below top line

``         // (two back quotes) move to the original position (the position where you issued the last G command),
           // unless you have made some edit.  If you have made an edit, and then moved the cursor using some
           // command other than G, `` will move the cursor to the site of last edit.  If you have issue a search
           // command (/ or ?), `` will move the cursor to where you started the search.  A pair of apostrophes works
           // much like two back quotes, except that it move the cursor to the beginning of the line instead of the
           // exact position on that line where your cursor had been.

What are some commands handy for developers?

%        // find matching paran 
>%       // shift all lines between matching parens 
>        // increase indentation 
<        // decrease indentation 

CTRL+D   // shift left one shift width (this is an insert mode command)
CTRL+T   // shift right one shift width (this is an insert mode command)

How can I join lines?

J        // join lines

You have to first select multiple lines using the visual mode command before pressing uppercase letter J.

How can I join the next 5 lines?

5J         // join the next 5 lines

How can I set a marker?

mx       // set marker (where x is a-z)

How can I see what markers are set?

:marks   // find what marks are set

What are the commands for insert and append?

a        // append text after the cursor position
A        // append text at the end of current line
i        // insert text before the cursor position
I        // insert text at the beginning of line
o        // insert a new line below the current line and go into insert mode
O        // insert a new line above the current line and go into insert mode

What are the commands to select lines and blocks of text?

V movement  // select lines
v movement  // select blocks
ctrl+v                // select columns
gv                    // reselect block

What is the command for re-indenting?

=        // re-indent

How can we insert a control character?

Ctrl+V      // the following character is a control character (this is an insert mode command)

How can I do autocompletion?

Ctrl+P   // autocompletion forward  (this is an insert mode command)
Ctrl+N   // autocompletion backward (this is an insert mode command)
ctrl+x ctrl+l         // line completion (in insert mode)
ctrl+x ctrl+k         // dictionary completion (in insert mode)

CTRL+N               // Complete a word from the current buffer, searching forward
CTRL+P               // Complete a word from the current buffer, searching backward
CTRL+X CTRL+K        // (insert mode) complete a word from a dictionary
CTRL+X CTRL+I        // (insert mode) complete a word from included files.
CTRL+X CTRL+D        // (insert mode) complete a macro (defined word) from included files.
CTRL+X CTRL+]        // (insert mode) complete words from a tag file
CTRL+X CTRL+F        // (insert mode) complete a file name
CTRL+X CTRL+L        // (insert mode) complete a whole line from the current buffer.

See :help ins-completion for more details.

How can I increase or decrease indentation?

CTRL-T   // increase indentation (this is an insert mode command) (command-mode keystroke: > )
CTRL-D   // decrease indentation (this is an insert mode command) (command-mode keystroke: < )

How can we use folding?

Use folds to collapse selected block of code or comment. First select a block of text, then :fold.

zo     // open
zc     // close

Also see :help foldmethod, mkview, loadview.

How can I comment out a block of Perl code

Press Ctrl+V and use the down/up arrow to select a block, then press I# followed by ESC

How can I uncomment a block of Perl code

Press Ctrl+V and use the down/up arrow to select a block, then press x

How can I view what changes I have made to the buffer before saving?

:%w tempfile
:diffsplit tempfile

How can I open multiple files in tabs?

vim -p file1 file2 file3

How can I edit a file that start with a dash?

Preceed the filelist with a '—' (2 hyphens)

How can I start vim in read-only mode?

Use the -R command line option.

How can I (as a system administrator) prevent vim users from accessing the shell?

Alias vim to rvim, rview, rgvim, rgview, or vim -Z

How can I prevent vim from using the ~/.viminfo fiel?

Specify -i NONE when launching vim on command line.

How can I make a script file?

Specifile -w {scriptfile} or -W {scriptfile}. All the characters that you type will be recorded until you exit vim.

How can I apply a script file?

I DO NOT KNOW THIS YET.

How can I execute the content of buffer a?

@a       // execute the content of buffer a

How can I repeat the last @ ?

@@      // repeat last @

How can I redo?

CTRL+R                      // redo (this is an insert mode command)

How can we switch to overstrike mode?

R          // switch to overstrike mode

How can I do abbreviation?

:ab imrc International Materials Research Center  // Now whenever your type imrc in insert mode, it expands to full text

Abbreviation expands as soon as you press a non-alphanumeric character, a space, or a carriage return, or ESC (returning to command mode).

:unab imrc  // disable abbreviation imrc
:ab         // list currently defined abbreviations.

The characters that compose your abbreviation cannot also appear at the end of your phrase.

How can we filter a block of text through a command?

You can send a block of text as standard input to a unix command. The output of this command replaces the block of text in the buffer.

:96,99!sort  // pass line2 96 through 99 through the sort filter and replace those lines with the output of sort.

What are some useful plugins?

  1. comments.vim. Download the file and put it in your ~/.vim/plugin directory. Ctrl+C to comments lines. Ctrl+X to uncomments lines.
  2. perl-support
  3. http://www.linuxjournal.com/article/7581
  4. http://www.perlmonks.org/index.pl?node_id=257782
  5. http://mamchenkov.net/wordpress/2004/05/10/vim-for-perl-developers/
  6. Vim Essential Plugin: SnipMate
  7. Vim Essential Plugin: Markdown to HTML
  8. Vim Essential Plugin: PeepOpen
  9. http://net.tutsplus.com/tutorials/other/vim-essential-plugin-nerdtree/
  10. http://zmievski.org/2010/06/vim-for-programmers-on-slideshare
  11. http://net.tutsplus.com/tutorials/other/vim-essential-plugin-markdown-to-html/
  12. http://net.tutsplus.com/tutorials/other/vim-essential-plugin-tcomment/
  13. http://net.tutsplus.com/sessions/vim-essential-plugins/
  14. http://net.tutsplus.com/tutorials/other/vim-essential-plugin-snipmate/
  15. http://net.tutsplus.com/tutorials/other/vim-essential-plugin-sparkup/
  16. http://net.tutsplus.com/tutorials/other/vim-essential-plugin-surround/
  17. http://net.tutsplus.com/tutorials/other/vim-essential-plugin-easymotion/
  18. https://github.com/Chiel92/vim-autoformat
tidy.vim
caramel.vim
less.vim
commenter.vim
pdoc4vim.vim
taglist.vim
perl-support.vim
tagmenu.vim
tagexplorer.vim
comments.vim
perl.vim
ctag.vim
perl_synwrite.vim
context_complete.vim
perl prove.vim
folding
pleasant.vim
perlcritic.vim
perl_synwrite.vim // check perl syntax before allowing to write

What are some useful references / articles?

  1. http://www.ukuug.org/events/linux2004/programme/paper-SMyers/Linux_2004_slides/vim_tips/
  2. vi fast reference guide
  3. vi
  4. VIM QUICK REFERENCE CARD
  5. http://www.pixelbeat.org/vim.tips.html
  6. http://www.rayninfo.co.uk/vimtips.html
  7. man vim, man vimtutor
  8. http://clipboarded.blogspot.com/2007/10/vim-as-ide.html
  9. http://www.sitepoint.com/effective-rails-development-vim
  10. http://www.sitepoint.com/getting-started-vim/
  11. http://c2.com/cgi/wiki?GreatVimFeatures
  12. http://www.sitepoint.com/editor-rubyists-use
  13. http://www.thegeekstuff.com/2009/01/vi-and-vim-macro-tutorial-how-to-record-and-play/
  14. http://vim.sourceforge.net/tips/tip.php?tip_id=589
  15. http://vim.sourceforge.net/scripts/script.php?script_id=1908
  16. http://www.linux.com/archive/feed/57727
  17. http://www.oualline.com/vim/10/top_10.html

How to install vim plugins?

What do I still wish to know?

  1. Delete matching parans without deleting the text in between
  2. highlight multiple search pattern (perhaps with different colors)
  3. vimdiff
  4. cvs integration
  5. subversion integration
  6. vim when type without specifying a file name, automatically open pre-registered / previously opened files

Unknown:

[{       // handy for discovering which function of 'if' clause this is in.
Ctrl+X   // copy, Ctrl+X Ctrl+P, Ctrl+X Ctrl+L (this is an insert mode command)
Ctrl+Y   // copying above characters (this is an insert mode command)
Ctrl+X Ctrl+F // filename completion (this is an insert mode command)
Ctrl+L   // refresh screen
CTRL+A   // insert previously inserted text
CTRL+R CTRL+Rx // do something
CTRL+Oc  // execute c in temporary command mode (c is a shell command) (this is an insert mode command)
ctrl+w, ctrl+i        // go through jump location
[I                    // show lines with matching word under the cursor
:@a
:! ctags *.c                // generate the tag file
:tag function_name   // look at the tag file, determine which file contain the function, and load that file

mkview, loadview, mksession

vim -S Session.vim

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License