This is a continuation of my list of favorite Vim plugins.

5. closetag

Closes HTML tags. To use closetag in several file types I set these variables:

let g:closetag_xhtml_filenames='*.html,*.xhtml,*.jsx,*.php,*.md,*.erb'
let g:closetag_filenames='*.html,*.xhtml,*.jsx,*.php,*.md,*.erb'

4. emmet

Auto completes HTML classes/ids/attributes and more. Emmet speeds up my HTML editing like no other plugin. I change its default map to Ctrl-e:

autocmd FileType html,eruby imap <c-e> <plug>(emmet-expand-abbr)

3. fugitive

Lets me use Git commands without leaving Vim. I define a few maps to avoid typing the full command names:

function CommitMessage()
  let message=input("Commit message: ")
  if message==""
    echo "Aborting commit due to empty commit message."
    return 1
  endif
  silent! execute "Gcommit -m'".message."'"
  echo "Successful commit"
endfunction

nnoremap <esc>G :call GcommitFile()<cr>
function! GcommitFile()
  Gwrite
  call CommitMessage
endfunction

nnoremap <esc>g :call GcommitAllFile()<cr>
function! GcommitAllFile()
  silent! Git add .
  redraw!
  call CommitMessage()
endfunction

noremap <silent> <esc>- :call GstatusResize()<cr>
function! GstatusResize()
  Gstatus
  execute 'resize'.line('$')
endfunction

2. vim-test

The best plugin for testing. I can define the granularity of my tests and it supports multiple languages. It’s specially powerful for TDD languages like Ruby. I have it mapped to:

nnoremap <esc>t :TestNearest<cr>
nnoremap <esc>T :TestFile<cr>

1. ctrlp

My favorite plugin is Ctrlp. It lets me find/edit files r-e-a-l-l-y fast. This is my configuration:

let g:ctrlp_working_path_mode='ra'  " start directory will be where .git is
let g:ctrlp_cmd='CtrlP'             " open CtrlP file mode
let g:ctrlp_open_multiple_files = '2hjr' " open two or more files in horizontal split
let g:ctrlp_open_new_file = 'r'     " open new files in current window
let g:ctrlp_prompt_mappings = {
    \ 'AcceptSelection("e")': ['<cr>', '<space>', '<2-LeftMouse>'],
    \ 'OpenMulti()':          ['<c-o>', '<c-m>'],
    \ }
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files | grep -v ".keep"']

That last line is quite useful. It limits the scope of ctrlp search to files checked out by Git.

Honorary mentions

NERDTree and Buffergator are two great plugins for codebase navigation. NERDTree is quite helpful when working under a single file tree. Buffergator is great when working with mulitple buffers not necessarely under the same file tree.