1、常用设置
编辑~/.vimrc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
syntax on "语法高亮 set nu "显示行号 "输入的命令显示出来,看得清楚些 set showcmd set nocompatible "设置配色方案 colorscheme murphy "设置编码 set fencs=utf-8,gb18030,gbk,gb2312 set termencoding=utf-8 set fileencoding=utf-8 set fileencoding=utf-8 set enc=utf-8 "代码补全 set completeopt=preview,menu "缩进设置 set autoindent set cindent set smartindent "Tab键宽度设置 set tabstop=4 set softtabstop=4 set shiftwidth=4 "历史纪录数 set history=1000 "不备份,禁止生成临时文件 set nobackup set noswapfile "搜索逐字符高亮 set hlsearch set incsearch "行内替换 set gdefault "文件类型 filetype on filetype plugin on filetype indent on "保存全局变量 set viminfo+=! "高亮匹配 set showmatch "文件类型检测 set completeopt=longest,menu "ctags设置 set tags=tags "行内替换 set gdefault |
设置执行代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
"< F5> 运行python map <F5> :call RunPython()<CR> func! RunPython() exec "W" if &filetype == 'python' exec "!time python2.7 %" endif endfunc "< F6> 编译和运行C++ map <F6> :call CompileRunGpp()<CR> func! CompileRunGpp() exec "w" exec "!g++ % -o %<" exec "! ./%<" endfunc " 运行shell程序 map <F8> :call CompileRunSH()<CR> func! CompileRunSH() exec "w" exec "!chmod a+x %" exec "!./%" endfunc |
2、插件
janus:https://github.com/carlhuda/janus
python 插件:https://github.com/rkulla/pydiction/archive/master.zip
Python 代码自动折叠:http://www.vim.org/scripts/script.php?script_id=515
插件管理工具vundle.vim:https://github.com/gmarik/vundle.git
nerdtree:https://github.com/scrooloose/nerdtree.git
youcompleteme插件
bufexplorer.zip
利用vim习惯使用 chrome的神器:Vimium
3、参考文档
https://www.zhihu.com/topic/19570193/hot
https://www.zhihu.com/question/20151659
https://www.cnblogs.com/linxiyue/p/7834817.html
http://www.jb51.net/article/58009.htm
http://www.cppblog.com/deercoder/archive/2011/10/22/158886.html
code
more code
~~~~