作为小白用户,记录一下自己在window7下的安装过程问题,github和vim以前已经安装过了,可以参考其他文章。
1. 安装Vundel:
2. 设置Curl
在github下的bin文件夹,创建curl.cmd文件:
内容为:
@rem Do not use "echo off" to not affect any child calls. @setlocal @rem Get the abolute path to the parent directory, which is assumed to be the @rem Git installation root. @for /F "delims=" %%I in ("%~dp0..") do @set git_install_root=%%~fI @set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%PATH% @if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH% @if not exist "%HOME%" @set HOME=%USERPROFILE% @curl.exe %*在cmd环境中运行:curl --version,就配置好了
3. 配置插件:
这下面是我之前的_vimrc里面的内容
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 =~ '\<cmd' let cmd = '""' . $VIMRUNTIME . '\diff"' let eq = '"' else let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"' endif else let cmd = $VIMRUNTIME . '\diff' endif silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq endfunction " REQUIRED. This makes vim invoke Latex-Suite when you open a tex file. filetype plugin on " IMPORTANT: win32 users will need to have 'shellslash' set so that latex " can be called correctly. set shellslash " IMPORTANT: grep will sometimes skip displaying the file name if you " search in a singe file. This will confuse Latex-Suite. Set your grep " program to always generate a file-name. set grepprg=grep\ -nH\ $* " OPTIONAL: This enables automatic indentation as you type. filetype indent on " OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to " 'plaintex' instead of 'tex', which results in vim-latex not being loaded. " The following changes the default filetype back to 'tex': let g:tex_flavor='latex' let g:Tex_DefaultTargetFormat = 'pdf' let g:Tex_CompileRule_pdf = 'pdflatex --synctex=-1 -src-specials -interaction=nonstopmode $*' "let SumatraPDF="D:Program Files/SumatraPDF-2.5.2/SumatraPDF.exe" let g:Tex_ViewRule_pdf = 'D:Program Files/SumatraPDF-2.5.2/SumatraPDF.exe -reuse-instance -inverse-search "gvim -c \":RemoteOpen +\%| \%f\""' " This set the grammar highlight by ls set nu! colorscheme desert syntax enable syntax on
改为:
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 =~ '\<cmd' let cmd = '""' . $VIMRUNTIME . '\diff"' let eq = '"' else let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"' endif else let cmd = $VIMRUNTIME . '\diff' endif silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq endfunction " ----------------- The Vundle ----------------- filetype off "required " set the runtime path to include Vundel and initialize set rtp +=$VIM/vimfiles/bundle/Vundle.vim call vundle#begin('$VIM/vimfiles/plugin_vundle') " alternatively, pass a path where Vundle should install plugins " call vundle#begin('~/some/path/here') " let Vundle manage Vundle, required Plugin 'gmarik/Vundle.vim' " The following are examples of different formats supported. " Keep Plugin commands betweenvundle#begin/end " plugin on Github repo " Plugin 'tpope/vim-fugitive' " plugin from http://vim-scripts.org/vim/scripts.html " Plugin 'L9' " Git plugin not hosted on Github " Plugin 'git://git.wincent.com/command-t.git' " git repos on your local machine (i.e. when working on your own plugin) " Plugin 'file:///home/gmraik/path/to/plugin' " The sparkup vim script is in a subdirectory of this repo called vim. " Pass the path to set the runtimepath properly. " Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} " Avoid a name confict with L9 " Plugin 'user/L9', {'name': 'newL9'} " All of your Plugins must be added before the following line call vundle#end() " required filetype plugin indent on "required " --------------------------------------------然后退出打开gvim,输入:PluginInstall,就成功了:
但是这个
call vundle#begin('$VIM/vimfiles/plugin_vundle')不能改为:
call vundle#begin('$VIM/vimfiles/bundle')就会出现下面的错误:
感觉这个有点坑爹啊,这样在plugin_vundle文件夹和bundle文件夹下都有这个Vundle.vim文件
参考:
【1】使用 Vundle 管理 Vim 插件 http://blog.log4d.com/2012/04/vundle/
【2】vim中的杀手级插件: vundle http://zuyunfei.com/2013/04/12/killer-plugin-of-vim-vundle/
【3】使用vundle进行插件管理(vim笔记二)http://jianshu.io/p/mHUR4e
【4】Vundle 管理 Vim 插件 http://www.zfanw.com/blog/vundle-vim-plugin-management.html
【5】gmarik/Vundle.vim https://github.com/gmarik/Vundle.vim
【6】Windows下配置Git http://blog.csdn.net/exlsunshine/article/details/18939329
【7】Windows下安装Vim插件管理Vundle http://blog.csdn.net/zhuxiaoyang2000/article/details/8636472
【8】AlloVince 的 VIM 配置方案 http://yp.oss.org.cn/blog/show_resource.php?resource_id=1561%E3%80%82