推荐俩vim plugin

1. unite.vim

文件查找插件,支持fuzzy search。之前一直用Command-T,其实还蛮好用的。但是Unite除了有对文件的查找,也有对buffer和yanks里的搜索,而且不依赖于ruby不用编译,拿来直接可用。
United.vim

以下是我的配置(忘了是从哪儿抄的了),是主要的搜索,b只在buffer里搜索,ctrl+j/k在搜索结果里移动, ctrl+l刷新cache。

"unite.vim config
call unite#filters#matcher_default#use(['matcher_fuzzy'])
call unite#filters#sorter_default#use(['sorter_rank'])
call unite#set_profile('files', 'smartcase', 1)

let g:unite_data_directory='~/.vim/.cache/unite'
let g:unite_enable_start_insert=1
let g:unite_source_history_yank_enable=1
let g:unite_source_rec_max_cache_files=5000

if executable('ag')
  let g:unite_source_grep_command='ag'
  let g:unite_source_grep_default_opts='--nocolor --nogroup -S -C4'
  let g:unite_source_grep_recursive_opt=''
elseif executable('ack')
  let g:unite_source_grep_command='ack'
  let g:unite_source_grep_default_opts='--no-heading --no-color -C4'
  let g:unite_source_grep_recursive_opt=''
endif

function! s:unite_settings()
  nmap <buffer> Q <plug>(unite_exit)
  nmap <buffer> <esc> <plug>(unite_exit)
  imap <buffer> <esc> <plug>(unite_exit)
  imap <buffer> <C-j>   <Plug>(unite_select_next_line)
  imap <buffer> <C-k>   <Plug>(unite_select_previous_line)
endfunction
autocmd FileType unite call s:unite_settings()

nmap <space> [unite]
nnoremap [unite] <nop>

nnoremap <silent> [unite]<space> :<C-u>Unite -toggle -auto-resize -buffer-name=mixed file_mru file_rec/async buffer bookmark<cr><c-u>
nnoremap <silent> [unite]f :<C-u>Unite -toggle -auto-resize -buffer-name=files file_rec/async<cr><c-u>
nnoremap <silent> [unite]y :<C-u>Unite -buffer-name=yanks history/yank<cr>
nnoremap <silent> [unite]l :<C-u>Unite -auto-resize -buffer-name=line line<cr>
nnoremap <silent> [unite]b :<C-u>Unite -auto-resize -buffer-name=buffers buffer<cr>
nnoremap <silent> [unite]/ :<C-u>Unite -no-quit -buffer-name=search grep:.<cr>
nnoremap <silent> [unite]m :<C-u>Unite -auto-resize -buffer-name=mappings mapping<cr>
nnoremap <silent> [unite]s :<C-u>Unite -quick-match buffer<cr>

2. vim-airline

这个就是纯粹为了好看来着。配着powerline补丁的字体,写代码的时候感觉更好了。
vim-airline

"vim-airline config
let g:airline_powerline_fonts = 1
let g:airline_enable_branch=1
let g:airline_enable_syntastic=1
let g:airline_detect_paste=1
let g:airline_theme='solarized'

[vim] show unicode character for tabs and line endings


I came across this config long time ago but never successfully set that up on company dev servers.

set listchars=tab:▸\ ,eol:¬

It always shows something like this:

set listchars=tab:?~V?\ ,eol:?

Until i saw this post on server fault, i realized it could be the same locale issue. Simply set the locale to en_US.utf8 solves the problem.

export LANG=en_US.utf8

 

vim plugin: AutoClose

http://www.vim.org/scripts/script.php?script_id=2009

自动补全括号..

让VIM方便写Doxygen

OS课老师要求用Doxygen的方式写注释,Doxygen是一个类似于javadoc的东东,可以自动生成很不错的document. Doxygen的主页在这里

在VIM里,有一个这个插件可以方便插入Doxygen的注释,只要在插入的地方:Dox即可,插件名叫DoxygenToolkit.vim,地址在这里