5 Essential vim plugins for programmers


Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor distributed with most UNIX systems.

Vim is often called a “programmer's editor,” and so useful for programming that many consider it an entire IDE. It's not just for programmers, though. Vim is perfect for all kinds of text editing, from composing email to editing configuration files.

Since Vim scripting has become quite powerful, many users have started writing scripts. The new plugin feature makes it easy to start using such a script: Just drop it in the right directory.

The following article introduces 5 of the most useful vim plugins for programmers.


The Taglist plugin

The TagList plugin is a source code browser plugin for Vim and provides an overview of the structure of source code files and allows you to efficiently browse through source code files for different programming languages.

These are the mappings that I use with Taglist :

:nnoremap ,T :Tlist<CR>
:nnoremap ,U :TlistUpdate<CR>
:nnoremap ,s :TlistSessionSave tlist<CR>
:nnoremap ,l :TlistSessionLoad tlist<CR>


The grep plugin

The grep plugin integrates the grep, fgrep, egrep, and agrep tools with Vim and allows you to search for a pattern in one or more files and jump to them.

To use this plugin, you need the grep, fgrep, egrep, agrep, find and xargs utilities. These tools are present in most of the Unix installations.

These are the mappings that I use with grep :

" Serch word under cursor in current dir
map <C-F> <esc>:Grep<CR>


The Version Control System (VCS) plugin

The VCS plugin is useful for manipulating files controlled by CVS, SVN, SVK and git within VIM, including committing changes and performing diffs using the vimdiff system.

These are the mappings that I use with VCS :

" Remove detault mappings
let VCSCommandDisableMappings=1

" Show 30 last lines from log related to the current file
nmap ,cl :VCSLog<CR>

" Show diffs with version in the CVS
nmap ,cd :VCSVimDiff<CR>

" Check-in the current version
nmap ,ci :VCSCommit <CR>

" Update current file
nmap ,cu :VCSUpdate <CR>

" Shows the status of the file
nmap ,cs :VCSStatus<CR>

" Remove diff colors
map  ,cc :set nodiff<CR>

The The NERD Commenter plugin

The NERD commenter plugin allows for easy commenting of code for many filetypes.

These are the mappings that I use with NERD commenter :

,c<space> |NERDComToggleComment|
Toggles the comment state of the selected line(s). If the topmost selected line is commented, all selected lines are uncommented and vice versa.

,cc |NERDComComment|
Comments out the current line or text selected in visual mode.

,cn |NERDComNestedComment|
Same as |NERDComComment| but forces nesting.

,cm |NERDComMinimalComment|
Comments the given lines using only one set of multipart delimiters if
possible.

,cs |NERDComSexyComment|
Comments out the selected lines ``sexily''

,c$ |NERDComEOLComment|
Comments the current line from the cursor to the end of line.

,cA |NERDComAppendComment|
Adds comment delimiters to the end of line and goes into insert mode between them.

The DrawIt plugin

The DrawIt plugin allows one to draw lines left, right, up, down, and along both slants. Optionally one may “cap” the lines with arrowheads. One may change the horizontal, vertical, slant, and crossing characters to whichever characters one wishes.

These are the mappings that I use with DrawIt :

   \di " to start DrawIt and
   \ds " to stop  DrawIt.

For more vim plugins, consult the online scripts database (http://www.vim.org/scripts/index.php).

What are your favorite vim plugins ?



Labels: , Wireless Internet Security Coding Network Monitoring

Comment

Enter your comment (wiki syntax is allowed):
WWUCN

Wireless Internet Security Performance RADIUS server Wireless Internet Security Performance RADIUS server