vim 配置文件

来源:互联网 发布:淘宝店橱柜只有15个 编辑:程序博客网 时间:2024/06/02 04:15

vim 配置

个人的配置文件如下:

"set autoindent"set cindentset encoding=utf-8setglobal fileencodings=utf-8,gb18030set termencoding=utf-8set ambiwidth=double" All system-wide defaults are set in $VIMRUNTIME/debian.vim (usually just" /usr/share/vim/vimcurrent/debian.vim) and sourced by the call to :runtime" you can find below.  If you wish to change any of those settings, you should" do it in this file (/etc/vim/vimrc), since debian.vim will be overwritten" everytime an upgrade of the vim packages is performed.  It is recommended to" make changes after sourcing debian.vim since it alters the value of the" 'compatible' option." This line should not be removed as it ensures that various options are" properly set to work with the Vim-related packages available in Debian."runtime! debian.vim" Uncomment the next line to make Vim more Vi-compatible" NOTE: debian.vim sets 'nocompatible'.  Setting 'compatible' changes numerous" options, so any other options should be set AFTER setting 'compatible'."set compatible" Vim5 and later versions support syntax highlighting. Uncommenting the next" line enables syntax highlighting by default.syntax enablesyntax on" If using a dark background within the editing area and syntax highlighting" turn on this option as wellset background=dark" Uncomment the following to have Vim jump to the last position when" reopening a fileif has("autocmd")au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")\| exe "normal g'\"" | endifendif" Uncomment the following to have Vim load indentation rules according to the" detected filetype. Per default Debian Vim only load filetype specific" plugins.if has("autocmd")filetype indent onendif" The following are commented out as they cause vim to behave a lot" differently from regular Vi. They are highly recommended though.set showcmd             " Show (partial) command in status line.set showmatch           " Show matching brackets."set ignorecase          " Do case insensitive matchingset smartcase           " Do smart case matchingset incsearch           " Incremental searchset autowrite           " Automatically save before commands like :next and :makeset hidden             " Hide buffers when they are abandoned""set mouse=a            " Enable mouse usage (all modes) in terminals"set mouse=            " Enable mouse usage (all modes) in terminals" Source a global configuration file if available" XXX Deprecated, please move your changes here in /etc/vim/vimrc"if filereadable("/etc/vim/vimrc.local")"source /etc/vim/vimrc.local"endif"set color scheme ,as you like"color darkbluecolor desert"replace tab with spacesset et"line will wrap when len>78"set tw=250"tab space is 4set ts=4"when you type < or >, shift width is 4set sw=4"set format options, (more info: type help fo-table)set fo+=tcroq"line numberset nu"a horizontal line under current cursor"set cursorline let Tlist_Show_One_File=1let Tlist_Exit_OnlyWindow=1let g:winManagerWindowLayout='FileExplorer|TagList'nmap wm :WMToggle<cr>:set cscopequickfix=s-,c-,d-,i-,t-,e-nmap <C-_>s :cs find s <C-R>=expand("<cword>")<CR><CR>nmap <C-_>g :cs find g <C-R>=expand("<cword>")<CR><CR>nmap <C-_>c :cs find c <C-R>=expand("<cword>")<CR><CR>nmap <C-_>t :cs find t <C-R>=expand("<cword>")<CR><CR>nmap <C-_>e :cs find e <C-R>=expand("<cword>")<CR><CR>nmap <C-_>f :cs find f <C-R>=expand("<cfile>")<CR><CR>nmap <C-_>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>"nmap <C-_>i :cs find i <C-R>=expand("<cfile>")<CR><CR>nmap <C-_>d :cs find d <C-R>=expand("<cword>")<CR><CR>vmap <F5> :s=^\(//\)*=//=g<cr>:noh<cr>nmap <F5> :s=^\(//\)*=//=g<cr>:noh<cr>nmap <F6> :s=^\(//\)*==g<cr>:noh<cr>vmap <F6> :s=^\(//\)*==g<cr>:noh<cr>"set makeprg=/root/qfang/bin/scons/scons.py\ -u\ \."miniBuf is sooooo sucks"noremap <Tab> <C-W>w:cd%:p:h<CR>:<CR>"let g:miniBufExplMapCTabSwitchBufs = 1"let g:miniBufExplMapWindowNavVim = 1"let g:miniBufExplMapWindowNavArrows = 1set completeopt=longest,menuset nocpfiletype plugin onmap <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>"set tags+=/usr/include/tagsset tags+=/home/admin/qiang.fangq/main_richtext_extractor/tagsset tags+=/home/admin/qiang.fangq/awrapper/tagsset tags+=/home/admin/qiang.fangq/usr_tagsset backspace=indent,eol,startset hlsearch""""""""""""""""""""""""""""""" vimgdb setting"""""""""""""""""""""""""""""""run macros/gdb_mappings.vim "pydiction 1.2 python auto completelet g:pydiction_location = '~/.vim/tools/pydiction/complete-dict'let g:pydiction_menu_height = 20let g:SuperTabRetainCompletionType=2let g:SuperTabDefaultCompletionType="<C-X><C-N>"map<F5> <ESC><F5>map<f5> :call AddComment()<cr>func AddComment()    if matchstr(getline('.'), '[^ ]') == '/'         normal ^xx     else        normal ^i//    endifendfuncimap <F6> <ESC><F6>noremap <f6> =a{ imap <F7> <ESC><F7>map<F7> :w<cr>:A<cr>imap <cr> <cr><left><right>map o o<left><right>map wm :NERDTree<cr>map <tab> gtautocmd BufNewFile,BufRead *.json set ft=javascript

配置步骤见网上教程

快捷键待更新:

0 0
原创粉丝点击