12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- ""--------------基础配置-------------------
- ""不要使用vi的键盘模式,而是vim自己的
- set nocompatible
- "" 使用 utf-8 编码
- set encoding=utf-8
- ""启用256色
- set t_Co=256
- "" 按下tab 空格两次
- set tabstop=2
- ""显示行号
- set number
- ""自动对齐
- set autoindent
- ""启动256色 和molokai插件颜色
- set t_Co=256
- syntax on
- set background=dark
- color molokai
- let g:molokai_original=1
- let g:rehash256=1
- set backspace=indent,eol,start
- ""光标所在行高亮
- set cursorline
- ""python自动补齐
- let g:pydiction_location = '~/.vim/bundle/pydiction/complete-dict'
- let g:pydiction_menu_height = 20
- let g:neocomplete#enable_at_startup = 1
- ""搜索时高亮
- set hlsearch
- ""搜索会跳过去
- set incsearch
- ""-----------------------------------x
- "" 开启文件类型检查,并且载入与该类型对应的缩进规则。比如,如果编辑的是.py文件,Vim
- "" 就是会找 Python 的缩进规则~/.vim/indent/python.vim。
- filetype off
- ""引入外置
- set rtp+=~/.vim/bundle/Vundle.vim
- ""ctrl v竖屏 x横屏 w横批切换 p文件搜索 t打开文件
- set rtp+=~/.vim/bundle/ctrlp.vim
- "" F7打开目录结构 desc返回上一个目录
- set rtp+=~/.vim/bundle/nerdtree
- set rtp+=~/.vim/bundle/self_vim/srech.vim
- set rtp+=~/.vim/bundle/neocomplete/plugin/neocomplete.vim
- ""下载常用插件
- call vundle#begin()
- Plugin 'VundleVim/Vundle.vim'
- call vundle#end()
- filetype plugin indent on
- "根据文件类型启动
- map <F5> :call Run() <CR>
- func! Run()
- if &filetype == "sh"
- :!time bash %
- elseif &filetype == "python"
- exec "!time python %"
- elseif &filetype == "go"
- exec "!go build %<"
- exec "!time go run %"
- endif
- endfunc
- map <F7> :NERDTreeToggle<CR>
|