介绍
安装Vundle插件管理器
代码语言:javascript复制git clone --depth=1 https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
git clone --depth=1 https://github.com/preservim/nerdtree.git ~/.vim/bundle/nerdtree
git clone --depth=1 https://github.com/Xuyuanp/nerdtree-git-plugin.git ~/.vim/bundle/nerdtree-git-plugin
更新配置文件
vim ~/.vimrc
代码语言:javascript复制set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp =~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'scrooloose/nerdtree'
Plugin 'Xuyuanp/nerdtree-git-plugin'
call vundle#end()
" 显示行号
set nu
" tabs键四空格
set ts=4
" 代码高亮
syntax enable
" 启用鼠标
" set mouse=a
" set selection=exclusive
" set selectmode=mouse,key
"显示状态栏
set laststatus=2
" 代码换行自动缩进
set autoindent
filetype plugin on
" 按 F5 执行当前 Python 代码"
map <F5> :call PRUN()<CR>
func! PRUN()
exec "w"
if &filetype == 'python'
exec "!python %"
endif
endfunc
" NerdTree才插件的配置信息
""将F2设置为开关NERDTree的快捷键
map <f3> :NERDTreeToggle<cr>
""修改树的显示图标
let g:NERDTreeDirArrowExpandable = ' '
let g:NERDTreeDirArrowCollapsible = '-'
""窗口位置
let g:NERDTreeWinPos='left'
""窗口尺寸
let g:NERDTreeSize=30
""窗口是否显示行号
let g:NERDTreeShowLineNumbers=1
""不显示隐藏文件
let g:NERDTreeHidden=0
安装插件
:PluginInstall