Vimrc 配置

发表信息: by

我的vimrc配置

" 设置显示行号
set number
" 设置显示tab
set list
set expandtab     " 使用空格代替tab. 
set tabstop=4     " 空格数量是4。 
set shiftwidth=4  " 自动缩进的宽度。 
set incsearch "设置增量搜索
set ruler "设置光标位置
set showmode "显示模式
set showcmd "显示命令
set nowrap "不折行显示
set listchars=tab:>-,trail:- "用>--显示tab, 用-显示空格
set sidescroll=10 "设置至少显示10个字符的上下文" 
set encoding=utf-8 "设置文件编码格式
set backspace=2 "解决退格键失效

map <c-f> :NERDTree<CR>
syntax enable "打开彩色的大门

"自动备份已修改的文件
if has("vms")
    set nobackup
else
    set backup
endif


"自定义函数   
func Run()
    let type = b:current_syntax
    if type == "go"
        exec "!go run %"
    elseif type == "python"
        exec "!python %"
    endif
endfunc

map <F5> :call Run()<CR>
        


" 用vundle安装插件
set nocompatible              " be iMproved, required
filetype off                  " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/vundle
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
" call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Bundle 'scrooloose/nerdtree'
Bundle 'tmhedberg/SimpylFold'
Bundle 'vim-scripts/indentpython.vim'
Bundle 'Valloric/YouCompleteMe'
Bundle 'vim-airline/vim-airline'
Bundle 'kien/ctrlp.vim'
" Bundle 'klen/python-mode'
" Plugin 'VundleVim/Vundle.vim'

call vundle#end()            " required
filetype plugin indent on    " required