vim配置
来源:互联网 发布:山西教师网络研修 编辑:程序博客网 时间:2024/06/07 06:55
runtime! debian.vim"设置编码set encoding=utf-8set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936set fileencodings=utf-8,ucs-bom,chinese "语言设置set langmenu=zh_CN.UTF-8 "设置语法高亮syntax enablesyntax on "设置配色方案colorscheme torte "可以在buffer的任何地方使用鼠标set mouse=aset selection=exclusiveset selectmode=mouse,key "高亮显示匹配的括号set showmatch "去掉vi一致性set nocompatible "设置缩进set tabstop=4set softtabstop=4set shiftwidth=4set autoindentset cindentif &term=="xterm" set t_Co=8 set t_Sb=^[[4%dm set t_Sf=^[[3%dmendif "打开文件类型自动检测功能filetype on "设置taglistlet Tlist_Show_One_File=0 "显示多个文件的tagslet Tlist_File_Fold_Auto_Close=1 "非当前文件,函数列表折叠隐藏let Tlist_Exit_OnlyWindow=1 "在taglist是最后一个窗口时退出vimlet Tlist_Use_SingleClick=1 "单击时跳转let Tlist_GainFocus_On_ToggleOpen=1 "打开taglist时获得输入焦点let Tlist_Process_File_Always=1 "不管taglist窗口是否打开,始终解析文件中的tag "设置WinManager插件let g:winManagerWindowLayout='FileExplorer|TagList'nmap wm :WMToggle<cr>map <silent> <F9> :WMToggle<cr> "将F9绑定至WinManager,即打开WimManager "设置CSCOPEset cscopequickfix=s-,c-,d-,i-,t-,e- "设定是否使用quickfix窗口显示cscope结果 "设置Grep插件nnoremap <silent> <F3> :Grep<CR> "设置一键编译map <F6> :make<CR> "设置自动补全filetype plugin indent on "打开文件类型检测set completeopt=longest,menu "关掉智能补全时的预览窗口 "启动vim时如果存在tags则自动加载if exists("tags") set tags=./tagsendif "设置按F12就更新tags的方法map <F12> :call Do_CsTag()<CR>nmap <C-@>s :cs find s <C-R>=expand("<cword>")<CR><CR>:copen<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>:copen<CR>nmap <C-@>t :cs find t <C-R>=expand("<cword>")<CR><CR>:copen<CR>nmap <C-@>e :cs find e <C-R>=expand("<cword>")<CR><CR>:copen<CR>nmap <C-@>f :cs find f <C-R>=expand("<cfile>")<CR><CR>:copen<CR>nmap <C-@>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>:copen<CR>nmap <C-@>d :cs find d <C-R>=expand("<cword>")<CR><CR>:copen<CR>function Do_CsTag() let dir = getcwd() if filereadable("tags") if(g:iswindows==1) let tagsdeleted=delete(dir."\\"."tags") else let tagsdeleted=delete("./"."tags") endif if(tagsdeleted!=0) echohl WarningMsg | echo "Fail to do tags! I cannot delete the tags" | echohl None return endif endif if has("cscope") silent! execute "cs kill -1" endif if filereadable("cscope.files") if(g:iswindows==1) let csfilesdeleted=delete(dir."\\"."cscope.files") else let csfilesdeleted=delete("./"."cscope.files") endif if(csfilesdeleted!=0) echohl WarningMsg | echo "Fail to do cscope! I cannot delete the cscope.files" | echohl None return endif endif if filereadable("cscope.out") if(g:iswindows==1) let csoutdeleted=delete(dir."\\"."cscope.out") else let csoutdeleted=delete("./"."cscope.out") endif if(csoutdeleted!=0) echohl WarningMsg | echo "Fail to do cscope! I cannot delete the cscope.out" | echohl None return endif endif if(executable('ctags')) "silent! execute "!ctags -R --c-types=+p --fields=+S *" silent! execute "!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q ." endif if(executable('cscope') && has("cscope") ) if(g:iswindows!=1) silent! execute "!find . -name '*.h' -o -name '*.c' -o -name '*.cpp' -o -name '*.java' -o -name '*.cs' > cscope.files" else silent! execute "!dir /s/b *.c,*.cpp,*.h,*.java,*.cs >> cscope.files" endif silent! execute "!cscope -b" execute "normal :" if filereadable("cscope.out") execute "cs add cscope.out" endif endifendfunction "设置默认shellset shell=bash "设置VIM记录的历史数set history=400 "设置当文件被外部改变的时侯自动读入文件if exists("&autoread") set autoreadendif "设置ambiwidthset ambiwidth=double "设置文件类型set ffs=unix,dos,mac "设置增量搜索模式set incsearch "设置静音模式set noerrorbellsset novisualbellset t_vb= "不要备份文件set nobackupset nowb
转自:http://www.oschina.net/code/snippet_76_2010
0 0
- vim配置NERD_tree.vim
- [Linux][Vim]:vim 配置
- vim配置NERD_tree.vim
- vim 配置vim
- vim 配置
- vim 配置
- vim配置
- vim 配置
- vim 配置
- vim 配置
- vim 配置
- vim配置
- vim配置
- VIM 配置
- vim 配置
- vim 配置
- VIM配置
- vim配置
- 使用print
- 近期对java编程的一些自我认知
- json解析性能比较(gson与jackson)
- Android GridView——如何以dp单位使用setColumnWidth()设置宽度
- 数据库备份
- vim配置
- 离职员工揭秘:知乎是怎么做内容社区运营的?
- 唐山帝瑞琳舒适家居-小众品牌在营销
- 控制文件(controlfile)丢失恢复
- hadoop序列化
- 将Oracle中的表结构导出到word
- 四种排序算法PHP实现类
- 六月十七日课堂理解
- 做了个实验,给一千万个随机数排序,用了24秒.不过内存使用有些高,下面是代码.使用的是双核.