安裝之前
1.系統為 windows10 Version 1607 64位 企業版
2.參考 http://www.codeweblog.com/gvim-64%E4%BD%8D-windows-7-%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B-%E4%BD%BF%E7%94%A8spf13%E9%85%8D%E7%BD%AE/
3.已經安裝了git version 2.9.0.windows.1 和 vim 8.0(鏈接:http://pan.baidu.com/s/1bLmjH8 密碼:vz8b) 都在D盤。
上面百度網盤的vim8我配置好支持lua,帶ctags下載直接可以。詳情請至 http://www.cnblogs.com/eastegg/p/6196525.html 查看關於lua的問題。
4.將要用到 git curl vim spf13-vim(當然) Vundle
開始安裝
1. Curl , 一般來說curl在安裝git的時候已經一起裝了。 一般來說 git 直接可以調用,而 curl 可能不行,所以要在Git 的 cmd 目錄下建立 curl.cmd (我瞎猜的)。
我的是 d:\Program Files\Git\cmd\curl.cmd ,內容是
1 @rem Do not use "echo off" to not affect any child calls. 2 @setlocal 3 4 @rem Get the abolute path to the parent directory, which is assumed to be the 5 @rem Git installation root. 6 @for /F "delims=" %%I in ("%~dp0..") do @set git_install_root=%%~fI 7 @set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%PATH% 8 9 @if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH% 10 @if not exist "%HOME%" @set HOME=%USERPROFILE% 11 12 @curl.exe %*
需要注意的是 64位 git 的 Curl 在 mingw64\bin 而不是 mingw\bin 。所以第七行我改了一下
@set PATH=%git_install_root%\bin;%git_install_root%\mingw64\bin;%PATH%
改完運行了下,發現在 cmd 中可以像 git 一樣直接用 curl 了。
2.之前在網上查了可以用 windows 包管理:Chocolatey 來安裝。但是裝上后單位網總是超時,索性直接從 github 上 clone 了。
裝到哪里,就在哪里用 cmd 運行 git clone -b 3.0 https://github.com/spf13/spf13-vim.git
然后進入 spf13-vim 目錄,管理員身份運行 spf13-vim-windows-install.cmd。如果安裝路徑沒有空格什么的不需要轉譯,到這里算裝完了。
1 REM Copyright 2014 Steve Francia 2 REM 3 REM Licensed under the Apache License, Version 2.0 (the "License"); 4 REM you may not use this file except in compliance with the License. 5 REM You may obtain a copy of the License at 6 REM 7 REM http://www.apache.org/licenses/LICENSE-2.0 8 REM 9 REM Unless required by applicable law or agreed to in writing, software 10 REM distributed under the License is distributed on an "AS IS" BASIS, 11 REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 REM See the License for the specific language governing permissions and 13 REM limitations under the License. 14 15 16 @if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH% 17 @if not exist "%HOME%" @set HOME=%USERPROFILE% 18 19 @set APP_PATH=%HOME%\.spf13-vim-3 20 IF NOT EXIST "%APP_PATH%" ( 21 call git clone -b 3.0 https://github.com/spf13/spf13-vim.git "%APP_PATH%" 22 ) ELSE ( 23 @set ORIGINAL_DIR=%CD% 24 echo updating spf13-vim 25 chdir /d "%APP_PATH%" 26 call git pull 27 chdir /d "%ORIGINAL_DIR%" 28 call cd "%APP_PATH%" 29 ) 30 31 call mklink "%HOME%\.vimrc" "%APP_PATH%\.vimrc" 32 call mklink "%HOME%\_vimrc" "%APP_PATH%\.vimrc" 33 call mklink "%HOME%\.vimrc.fork" "%APP_PATH%\.vimrc.fork" 34 call mklink "%HOME%\.vimrc.bundles" "%APP_PATH%\.vimrc.bundles" 35 call mklink "%HOME%\.vimrc.bundles.fork" "%APP_PATH%\.vimrc.bundles.fork" 36 call mklink "%HOME%\.vimrc.before" "%APP_PATH%\.vimrc.before" 37 call mklink "%HOME%\.vimrc.before.fork" "%APP_PATH%\.vimrc.before.fork" 38 call mklink /J "%HOME%\.vim" "%APP_PATH%\.vim" 39 40 IF NOT EXIST "%APP_PATH%\.vim\bundle" ( 41 call mkdir "%APP_PATH%\.vim\bundle" 42 ) 43 44 IF NOT EXIST "%HOME%/.vim/bundle/vundle" ( 45 call git clone https://github.com/gmarik/vundle.git "%HOME%/.vim/bundle/vundle" 46 ) ELSE ( 47 call cd "%HOME%/.vim/bundle/vundle" 48 call git pull 49 call cd %HOME% 50 ) 51 52 call vim -u "%APP_PATH%/.vimrc.bundles" +BundleInstall! +BundleClean +qall
我的安裝路徑是 Program Files (x86) 23行的 %CD% 是要被“”包圍才能正常賦值,因為我的路徑有空格XC 所以改成
@set ORIGINAL_DIR=“%CD%”
於是下面引用的 ORIGINAL_DIR 的27行也要修改,不改的話會變成前后都有括號
chdir /d %ORIGINAL_DIR%
ps:項目地址 https://github.com/spf13/spf13-vim 另外時間長了地址可能會變,到時候再在 github 里搜吧。
3.等 vim 的 bundle 安裝完插件就結束了。剩下的就是自定義配置了
4.第二次安裝出現了缺少ctags的錯誤,后發現直接下載ctags后。把解壓目錄放入系統環境變量可解決問題。