备份一下自己的vimrc脚本, 有需要的兄弟拿走不谢~~
set tabstop=4 " 设置tab键的宽度
set shiftwidth=4 " 换行时行间交错使用4个空格
set expandtab " 将每个TAB替换为空格,如果要输入真正的TAB,请使用CTRL-V TAB
set backspace=2 " 设置退格键可用
set nonu " 不显示行号
set nowrap " 不自动换行
set linebreak " 整词换行
set whichwrap=b,s,<,>,[,] " 光标从行首和行末时可以跳到另一行去
set hidden " 没有保存的缓冲区可以自动被隐藏
set scrolloff=5
set mouse=a " 使用mouse在所有模式下
set hlsearch " 高亮显示搜索结果
set incsearch " 查询时非常方便,如要查找book单词,当输入到/b时,会自动找到
set gdefault " 替换时所有的行内匹配都被替换,而不是只有第一个
set ic "搜索时忽略大小写
set tpm=256
" 设置vimdiff的配色,比默认的要清晰很多
if &diff
colors blue
endif
et statusline=[%F]%y%r%m%*%=[Line:%l/%L,Column:%c][%p%%]
set laststatus=2 " always show the status line
set ruler " 在编辑过程中,在右下角显示光标位置的状态行
filetype pluginindenton " 加了这句才可以用智能补全
syn on " 打开语法高亮
set showmatch " 设置匹配模式,类似当输入一个左括号时会匹配相应的那个右括号
set nosmartindent " 关掉智能对齐方式
set noautoindent " 关掉自动对齐
map <F4> :set paste<CR>
map <F5> :set nopaste<CR>
imap <F4> <C-O>:set paste<CR>
imap <F5> <nop>
set pastetoggle=<F5>
set foldmethod=syntax
set foldlevel=100 " Don't autofold anything (but I can still fold manually)
nmap wv <C-w>v " 垂直分割当前窗口
nmap wc <C-w>c " 关闭当前窗口
nmap ws <C-w>s " 水平分割当前窗口
nmap <F2> :w<cr>
imap <F2> <Esc>:w<cr>i<Right>
nmap <F3> :q!<cr>
imap <F3> <Esc>:q!<cr>
nmap <F8> :tabe<Space>
imap <F8> <Esc>:tabe<Space>
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow = 1
let Tlist_Use_Right_Window=1
nnoremap <silent> <F9> :TlistToggle<CR>
nmap <F6> :cp<cr> " 切换到上一个结果
nmap <F7> :cn<cr> " 切换到下一个结果
let g:winManagerWindowLayout='FileExplorer|BufExplorer'
let g:winManagerWidth = 30
let g:defaultExplorer = 1
nmap <F10> :WMToggle<cr> " 是nomal模式的命令,不是Ex模式的
map <C-m> :NERDTreeToggle<CR>
if has("cscope")
set csprg=${HOME}/bin/cscope
set csto=0
set cst
set nocsverb
" add any database in current directory
if filereadable("cscope.out")
cs add cscope.out
" else add database pointed to by environment
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
set csverb
endif
:set cscopequickfix=s-,c-,d-,i-,t-,e-
:set cscopetag
nnoremap <unique> ,- gT
nnoremap <unique> ,= gt