1. 我平时喜欢IDE与Vim混用,IDE可以配一键开VIM。
2. 由于开发以IDE为主Vim为辅助,基本上不装太酷炫的插件。常用的插件是:
Plugin 'https://github.com/easymotion/vim-easymotion.git' Plugin 'git://github.com/tpope/vim-surround.git' Plugin 'kshenoy/vim-signature' Plugin 'terryma/vim-multiple-cursors' Plugin 'junegunn/vim-easy-align' Plugin 'https://github.com/gcmt/taboo.vim.git' Plugin 'https://github.com/mhinz/vim-grepper.git' Plugin 'https://github.com/Chun-Yang/vim-action-ag.git' Plugin 'https://github.com/Valloric/YouCompleteMe.git' Plugin 'https://github.com/kien/rainbow_parentheses.vim' Plugin 'https://github.com/tpope/vim-fugitive.git' Plugin 'junegunn/fzf.vim'
重点推荐 vim-multiple-cursors和vim-easy-align,在IDE中开VIM往往是为了用这两个功能。
3. 一些常用配置项目
"Swap vnoremap <C-S-X> <ESC>`.``gvp``P
nmap <C-S-U> gUiwe imap <C-S-U> <ESC>gUiwgi
function! CopyToBottom() let l:a = input("Copy to bottom with Regex: ") execute "g/".l:a."/t$" endfunction noremap <Leader>zg :call CopyToBottom()<CR>
" select the pasted block nnoremap <expr> gp '`[' . strpart(getregtype(), 0, 1) . '`]'
nnoremap zpr :setlocal foldexpr=(getline(v:lnum)=~@/)?0:(getline(v:lnum-1)=~@/)\\|\\|(getline(v:lnum+1)=~@/)?1:2 foldmethod=expr foldlevel=0 foldcolumn=2<CR>:set foldmethod=manual<CR><CR>
4. 擅用!命令
比如说,在shell里安装
npm install -g js-beautifier npm install -g esprima