前言

从12年到17年一直用的Mac Air,最近听说MBP重量、体积已经跟Air差不多了,正好该换笔记本了,入手了一台比较高配的MBP,i5+16G+512G SSD,视网膜屏幕看着清晰太多了。麻烦的是用了这么多年的环境又要重新配置一遍,iterm2+zsh+vim是首先要搞定的。欣喜发现,有个哥们做了个vim的package叫 Ultimate vimrc,扩展性不错,把以前需要自己做的事打包了,节省了不少时间,备注一下Ultimate vimrc集成的插件。

vim插件

以下大部分插件使用Ultimate vimrc会自动安装,配置文 ~/.vim_runtime/my_configs.vim。当前配置下,leader是“,”。

名称 功能 配置 快捷键 帮助
bufexplorer Quickly and easily switch between buffers map <leader>
o :BufExplorer<cr>
ctrlp Fuzzy file, buffer, mru and tag finder. 根据名称搜索 file、buffer、tag let g:ctrlp_map = ''
lightline A light and configurable statusline/tabline for Vim
NERD Tree A tree explorer plugin for vim,历史悠久,vim自带netrw map <leader>
nn :NERDTreeToggle<cr>
map <leader>
nb :NERDTreeFromBookmark
t: 在新的tab中打开文件
R: 刷新目录
:help nerdtree
mru Plugin to manage Most Recently Used (MRU) files map <leader>f :MRU<CR>
open_file_under_cursor Open file under cursor gf
pathogen Manage your vim runtimepath
vim-commentary Comment stuff out gcc
gc
gcu
:help commentary
vim-indent-object Defines a new text object representing lines of code at the same indent level
根据缩进选中文本块,选中之后使用'shift+<' 和 'shift+>' 来进行缩进
ai
ii
aI
iI
:help indent-object
vim-yankstack Maintains a history of previous yanks, changes and deletes Remove all clutter and focus only on the essential.
记录 yank 的历史记录,在paste的时候可以选择
set macmeta
map <leader>y :Yanks<CR>
meta + p
meta + shift + p
meta 就是 option
ack Vim plugin for the_silver_searcher(ag) or ack -- a wicked fast grep map <leader>g :Ack
smooth-scroll scrolls the lines fluidly to help the user know how far they are scrolling in the file
nnoremap <silent> <c-u> :call smooth_scroll#up( &scroll2)<CR>
nnoremap <silent> <c-d> :call smooth_scroll#down(&scroll
2)<CR>
使用Ctrl+u和Ctrl+d 来上翻和下翻
goyo & vim-zenroom2
snipmate snipmate.vim aims to be a concise vim script that implements some of TextMate's snippets features in Vim
syntastic Syntax checking hacks for vim
vim-expand-region Allows you to visually select increasingly larger regions of text using the same key combination
vim-fugitive A Git wrapper so awesome, it should be illegal
vim-multiple-cursors Sublime Text style multiple selections for Vim, CTRL+N is remapped to CTRL+S (due to YankRing)