MacVim使用Vundle安装NERDTree并配置

vim打开用户主目录下的.vimrc文件,由之前复制到vimrc的Vundle配置中的说明

" plugin on GitHub repo

Plugin 'tpope/vim-fugitive'

可知, 在GitHub仓库中管理的插件用这种用户名/插件名的方式在vimrc文件中表示,所以要用Vundle管理NERDTree需在vimrc文件里添加以下语句

Plugin 'scrooloose/nerdtree'

再将NERDTree的配置语句复制到vimrc文件的最后:

" NERDTree config

" 使用F2做NERDTree的快捷键

map <F2>:NERDTreeToggle<CR>

" 关闭vim时,只有NERTTree打开时,自动关闭,减少多次按:q!.

autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType)

" 打开Vim时自动打开NERDTree

autocmd vimenter * NERDTree


发布了31 篇原创文章 · 获赞 7 · 访问量 7万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章