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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
| if version >= 603 set helplang=cn endif
" 语法高亮 syntax enable syntax on
set hlsearch " 搜索高亮设置 set nu " 显示行号 set ts=4 " table 缩进 4 个空格 set sw=4 " 自动缩进的时候缩进 4 个空格 set noexpandtab " 让 table 还原成 table 而非空格
set autoindent " 自动缩进 set incsearch " 逐步搜索模式,对当前键入的字符进行搜索而不必等待键入完成
" 字符编码相关设置 set encoding=utf-8 set fileencodings=ucs-bom,utf-8,cp936 set fileencoding=gb2312 set termencoding=utf-8
" 分割窗口改变窗口的尺寸 nnoremap t= :resize +5<CR> " 垂直 nnoremap t- :resize -5<CR> nnoremap t, :vertical resize +5<CR> nnoremap t. :vertical resize -5<CR> " 水平 nnoremap tj :resize +5<CR>
" 每次保存文件时,自动更新 tags " autocmd BufWritePost *.cpp,*.c,*.h silent! :!ctags -R --sort=yes --c++-kinds=+p --fields=+iaS --extra=+q
"高亮当前行 set cursorline hi CursorLine cterm=NONE ctermbg=black ctermfg=NONE " hi CursorColumn cterm=NONE ctermbg=darkred ctermfg=white
" 字符高亮 nmap <silent><F4> :nohl<CR> "取消高亮
"窗口上下左右选择键 nnoremap th <C-W>h nnoremap tj <C-W>j nnoremap tk <C-W>k nnoremap tl <C-W>l
"""""""""""""""""""""""""""""" " cscope """""""""""""""""""""""""""""" if filereadable("cscope.out") cs add cscope.out endif
nmap <F2>s :cs find s <C-R>=expand("<cword>")<CR><CR> nmap <F2>g :cs find g <C-R>=expand("<cword>")<CR><CR> nmap <F2>c :cs find c <C-R>=expand("<cword>")<CR><CR> nmap <F2>t :cs find t <C-R>=expand("<cword>")<CR><CR> nmap <F2>e :cs find e <C-R>=expand("<cword>")<CR><CR> nmap <F2>f :cs find f <C-R>=expand("<cfile>")<CR><CR> nmap <F2>i :cs find i <C-R>=expand("<cfile>")<CR><CR> nmap <F2>d :cs find d <C-R>=expand("<cword>")<CR><CR>
call plug#begin('~/.vim/plugged') " 插件会被安装到这里 Plug 'theniceboy/vim-deus' Plug 'itchyny/lightline.vim'
" ------------------------------------------------------ 括号颜色插件 rainbow_parentheses 以及配置 Plug 'kien/rainbow_parentheses.vim' let g:rbpt_colorpairs = [ \ ['brown', 'RoyalBlue3'], \ ['Darkblue', 'SeaGreen3'], \ ['darkgray', 'DarkOrchid3'], \ ['darkgreen', 'firebrick3'], \ ['darkcyan', 'RoyalBlue3'], \ ['darkred', 'SeaGreen3'], \ ['darkmagenta', 'DarkOrchid3'], \ ['brown', 'firebrick3'], \ ['gray', 'RoyalBlue3'], \ ['darkmagenta', 'DarkOrchid3'], \ ['Darkblue', 'firebrick3'], \ ['darkgreen', 'RoyalBlue3'], \ ['darkcyan', 'SeaGreen3'], \ ['darkred', 'DarkOrchid3'], \ ['red', 'firebrick3'], \ ]
let g:rbpt_max = 16 let g:rbpt_loadcmd_toggle = 0 au VimEnter * RainbowParenthesesToggle au Syntax * RainbowParenthesesLoadRound au Syntax * RainbowParenthesesLoadSquare au Syntax * RainbowParenthesesLoadBraces " 通过 :RainbowParenthesesToggle 命令启动插件 ---------- rainbow_parentheses 完成配置
call plug#end()
|