Gvim安装和配置

1.安装好了gvm之后,在安装目录下面找到_vimrc 按如下配置配置即可:

2.

    set nocompatible  
    source $VIMRUNTIME/vimrc_example.vim  
    source $VIMRUNTIME/mswin.vim  
    behave mswin  
      
    set diffexpr=MyDiff()  
    function MyDiff()  
      let opt = '-a --binary '  
      if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif  
      if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif  
      let arg1 = v:fname_in  
      if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif  
      let arg2 = v:fname_new  
      if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif  
      let arg3 = v:fname_out  
      if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif  
      let eq = ''  
      if $VIMRUNTIME =~ ' '  
        if &sh =~ '/ ' . arg3 . eq  
    endfunction  
      
    "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    " Add by minico---begin  
    "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
      
    "设置帮助语言  
    set helplang=cn,en  
      
    "把gui的工具栏去掉(要去掉,把等号前面的加号变成一个减号即可)  
    set guioptions+=T  
      
    "把gui的右边的滑动条去掉  
    set guioptions+=r  
      
    "把gui的左边的滑动条去掉  
    set guioptions-=L  
      
    "把gui的菜单去掉  
    set guioptions+=m  
    filetype on  
    let Tlist_Show_Menu = 1  
      
    " 这项必须设定,否则出错,配置taglist的ctags路径  
    "let Tlist_Ctags_Cmd = 'D:/Vim/vim71/ctags.exe'  
      
      
    "设置Taglist  
    let Tlist_Show_One_File=1  
    let Tlist_Exit_OnlyWindow=1  
      
    " 使用F8打开Taglist  
    nnoremap   :TlistToggle  
      
    "设置窗口大小和位置  
    set lines=80  
    set columns=200  
    winpos 0 0  
      
    "设置tags文件路径  
    set tags=G:/lwip/tags  
      
    "设置文件浏览器窗口显示方式  
    "通过WinManager插件来将TagList窗口和netrw窗口整合起来  
    let g:winManagerWindowLayout='FileExplorer|TagList'  
    nmap wm :WMToggle  
      
    "设置SuperTab,用tab键打开cppcomplet的自动补全功能。  
    let g:SuperTabRetainCompletionType=2  
    let g:SuperTabDefaultCompletionType=""  
      
    "显示行号  
    set number  
      
    "打开语法高亮显示功能  
    syntax enable  
    syntax on  
      
    "设置主题颜色  
    colorscheme desert  
      
    "则可以用切换到上下左右的窗口中去  
    let g:miniBufExplMapWindowNavVim = 1  
      
    "按F12时在一个新的buffer中打开c/h文件  
    nnoremap   :A  
      
    "用F3调用grep查找当前光标所在处的字符串  
    nnoremap   :Grep  
      
    "为了使用智能补全,打开文件类型检测,关闭VI兼容模式  
    filetype plugin indent on  
    set nocp  
      
    "关掉智能补全时的预览窗口,这样可以防止闪屏现象  
    set completeopt=longest,menu  
      
    "====================Lookupfile 相关设置========================================  
      
    let g:LookupFile_MinPatLength = 2               "最少输入2个字符才开始查找  
    let g:LookupFile_PreserveLastPattern = 0        "不保存上次查找的字符串  
    let g:LookupFile_PreservePatternHistory = 1     "保存查找历史  
    let g:LookupFile_AlwaysAcceptFirst = 1          "回车打开第一个匹配项目  
    let g:LookupFile_AllowNewFiles = 0              "不允许创建不存在的文件  
    if filereadable("./filenametags")                "设置tag文件的名字  
        let g:LookupFile_TagExpr = '"./filenametags"'  
    endif  
    "nmap  lk LookupFile   "映射LookupFile为,lk  
    "nmap  ll :LUBufs            "映射LUBufs为,ll  
    "nmap  lw :LUWalk            "映射LUWalk为,lw  
      
    "有了上面的定义,当我输入”,lk”时,就会在tag文件中查找指定的文件名;  
    "当输入”,ll”时,就会在当前已打开的buffer中查找指定名字的buffer;  
    "当输入”,lw”时,就会在指定目录结构中查找。  
      
    "在用lookupfile插件查找文件时,是区分文件名的大小写的,  
    "如果想进行忽略大小写的匹配,把下面这段代码加入你的vimrc中,  
    "就可以每次在查找文件时都忽略大小写查找了:  
      
    " lookup file with ignore case  
    function! LookupFile_IgnoreCaseFunc(pattern)  
        let _tags = &tags  
        try  
            let &tags = eval(g:LookupFile_TagExpr)  
            let newpattern = '/c' . a:pattern  
            let tags = taglist(newpattern)  
        catch  
            echohl ErrorMsg | echo "Exception: " . v:exception | echohl NONE  
            return ""  
        finally  
            let &tags = _tags  
        endtry  
      
        " Show the matches for what is typed so far.  
        let files = map(tags, 'v:val["filename"]')  
        return files  
    endfunction  
    let g:LookupFile_LookupFunc = 'LookupFile_IgnoreCaseFunc'  
      
    nnoremap  :  
    vnoremap  :  
    "====================Lookupfile 相关设置 end========================================  
      
    "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    " Add by minico---end  
    "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  

 
  
 
  
 
  
 
 

你可能感兴趣的:(编程工具)