vim 配置文件

来源:互联网 发布:车辆保险的算法 编辑:程序博客网 时间:2024/06/05 04:54
colorscheme desert"desert主题set guifont=Monospace\ 14set lines=25 columns=80"启动窗口大小set number"显示行号set smartindent"自动缩进set nocompatible"非兼容vi模式,避免以前版本的一些bug和局限set mouse=a"为所有模式启用鼠标set showmatch"括号配对情况set whichwrap=b,s,<,>,[,]"让退格,空格,上下箭头遇到行首行尾时自动移到下一行syntax on"语法高亮set softtabstop=4"tab当成的空格数set shiftwidth=4"自动缩进一步空格数set hlsearch"高亮search命中的文本。set ignorecase"搜索时忽略大小写set incsearch"随着键入即时搜索set smartcase"有一个或以上大写字母时仍大小写敏感autocmd! bufwritepost .vimrc source %"保存配置后自动加载autocmd InsertLeave * if pumvisible() == 0|pclose|endif    "退出插入模式关闭预览"gui模式下不折行加滚动条if (has("gui_running"))" 图形界面下的设置    set nowrap    set guioptions+=belse" 字符界面下的设置    set wrapendif"""""""""""""""""""""""""""""""""""""快捷键"""""""""""""""""""""""""""""""""""""前导符号let g:mapleader = ','"相对/绝对行号转换map <c-n> :call NumberToggle()<CR>cnoremap <c-n> :call NumberToggle()<CR>"esc的映射inoremap jj <Esc>cnoremap jj <Esc>vnoremap jj <Esc>"插入模式下移动inoremap <c-j> <down>inoremap <c-k> <up>inoremap <c-l> <right>inoremap <c-h> <left>"窗口切换nnoremap <c-j> <c-w>jnnoremap <c-k> <c-w>knnoremap <c-l> <c-w>lnnoremap <c-h> <c-w>h"切换到当前目录nnoremap <leader>cd :execute "cd" expand("%:h")<CR>"复制粘贴vmap <c-c> "+ynmap <c-v> "+pimap <c-v> <esc>"+pa" 按;直接进入命令行模式nnoremap ; :"保存nnoremap <c-s> <esc>:w<CR>inoremap <c-s> <esc>:w<CR>vnoremap <c-s> <esc>:w<CR>"""""""""""""""""""""""""""""""""""""""""插件管理""""""""""""""""""""""""""""""""""""""""filetype off                  " required" set the runtime path to include Vundle and initializeset rtp+=~/.vim/bundle/vundle/call vundle#rc()" alternatively, pass a path where Vundle should install bundles"let path = '~/some/path/here'"call vundle#rc(path)" let Vundle manage Vundle, requiredBundle 'gmarik/vundle'"-------------------------------"YouCompletMe 自动补全Bundle 'Valloric/YouCompleteMe'nnoremap <F5> :YcmForceCompileAndDiagnostics<CR>let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'"默认配置文件let g:ycm_confirm_extra_conf = 0"不提示确认配置文件let g:ycm_show_diagnostics_ui = 0"-------------------------------"括号自动配对Bundle 'git://github.com/vim-scripts/Auto-Pairs.git'"-------------------------------"彩色括号Bundle 'git://github.com/kien/rainbow_parentheses.vim.git'let g:rbpt_colorpairs = [    \ ['brown',       'RoyalBlue3'],    \ ['Darkblue',    'SeaGreen3'],    \ ['darkgray',    'DarkOrchid3'],    \ ['darkgreen',   'firebrick3'],    \ ['darkcyan',    'RoyalBlue3'],    \ ['darkred',     'SeaGreen3'],    \ ['darkmagenta', 'DarkOrchid3'],    \ ['brown',       'firebrick3'],    \ ['gray',        'RoyalBlue3'],    \ ['black',       'SeaGreen3'],    \ ['darkmagenta', 'DarkOrchid3'],    \ ['Darkblue',    'firebrick3'],    \ ['darkgreen',   'RoyalBlue3'],    \ ['darkcyan',    'SeaGreen3'],    \ ['darkred',     'DarkOrchid3'],    \ ['red',         'firebrick3'],    \ ]let g:rbpt_max = 16let g:rbpt_loadcmd_toggle = 0au VimEnter * RainbowParenthesesToggleau Syntax * RainbowParenthesesLoadRoundau Syntax * RainbowParenthesesLoadSquareau Syntax * RainbowParenthesesLoadBraces"--------------------------------------------"Valloric/ListToggleBundle 'Valloric/ListToggle'let g:lt_height = 5"--------------------------------------------"语法检查Bundle 'scrooloose/syntastic'let g:syntastic_always_populate_loc_list = 1let g:syntastic_check_on_open = 1let g:syntastic_enable_balloons = 1let g:syntastic_auto_loc_list = 0let g:syntastic_python_checkers = ['pylint']let g:syntastic_python_pylint_exe = 'python3-pylint'"--------------------------------------------"添加\删除\修改括号对Bundle 'git://github.com/tpope/vim-surround.git'"--------------------------------------------"缩进标识Bundle 'Yggdroot/indentLine'"--------------------------------------------"状态栏增强Bundle 'git://github.com/Lokaltog/vim-powerline.git'set laststatus=2"--------------------------------------------"taglistBundle 'taglist.vim'let Tlist_Exit_OnlyWindow = 1let Tlist_File_Fold_Auto_Close = 1let Tlist_Show_Menu = 1let Tlist_Use_Right_Window=1nnoremap <silent> <F8> :TlistToggle<CR>"--------------------------------------------"目录树Bundle 'scrooloose/nerdtree'nnoremap <leader>n :NERDTree<CR>"--------------------------------------------"TODO列表Bundle 'TaskList.vim'"--------------------------------------------"自定义补全Bundle 'SirVer/ultisnips'let g:UltiSnipsListSnippets="<c-l>"let g:UltiSnipsExpandTrigger="<c-tab>"let g:UltiSnipsJumpForwardTrigger="<tab>"let g:UltiSnipsJumpBackwardTrigger="<s-tab>"filetype plugin indent on     " required!"" Brief help" :BundleList          - list configured bundles" :BundleInstall(!)    - install (update) bundles" :BundleSearch(!) foo - search (or refresh cache first) for foo" :BundleClean(!)      - confirm (or auto-approve) removal of unused bundles"" see :h vundle for more details or wiki for FAQ" NOTE: comments after Bundle commands are not allowed." 相对绝对行号转换function! NumberToggle()  if(&relativenumber == 1)    set norelativenumber number  else    set relativenumber  endifendfunc

0 0
原创粉丝点击