我使用Vagrant和VirtualBox來設置和配置Ubuntu Trusty機器。在配置階段,我正在下載我的點文件(其中包括我的.vimrc
和.tmux.conf
文件以及我的.vim
文件夾)。無法加載Ubuntu上的Vim插件trusty64
我.tmux.conf
工作正常,但我發現我的.vimrc
是無法加載我的插件(我用的是病原插件管理器),所以當我啓動Vim我看到沒有被發現的某些配色方案錯誤(因爲特定的顏色方案通過插件加載)以及我的.vimrc中的一些其他插件相關設置導致顯示錯誤。
下面是我Vagrantfile
(不,這是相關的,但如果你想知道我使用最多從Linux實例內容框中):
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network :private_network, ip: "172.17.8.100"
config.vm.synced_folder "./Application", "/www", create: true
config.vm.provision "shell" do |s|
s.privileged = true
s.path = "provision.sh"
end
config.ssh.forward_agent = true
config.ssh.forward_x11 = true
end
完整的配置腳本可以在這裏查看: https://github.com/Integralist/Linux-and-Docker-Development-Environment/blob/master/provision.sh但重要的部分(即我點文件的git的克隆並檢查了相關linux
分支)如下:
dotfiles_location=/home/vagrant/dotfiles
git clone https://github.com/Integralist/dotfiles.git $dotfiles_location
cd $dotfiles_location && git fetch && git checkout linux
shopt -s extglob
mv !(.|..|.git|README.md) ..
在上面的代碼中,我將所有的點文件(即.vimrc
, .vim
和.tmux.conf
)轉換爲/home/vagrant/
(注意:括號內指定的文件並未被移動,如.git
文件夾)。
當我執行vim
我得到以下錯誤:
Error detected while processing /home/vagrant/.vimrc:
line 125:
E185: Cannot find color scheme 'Tomorrow-Night'
然後再Vim,它的誤差範圍內:
Error detected while processing VimEnter Auto commands for "*":
E492: Not an editor command: RainbowParenthesesToggle
我看了其他Linux相關的問題對病原回購,但我無法確定問題來自哪裏?
執行:scriptnames
回報:
1: /usr/share/vim/vimrc
2: /usr/share/vim/vim74/debian.vim
3: /usr/share/vim/vim74/syntax/syntax.vim
4: /usr/share/vim/vim74/syntax/synload.vim
5: /usr/share/vim/vim74/syntax/syncolor.vim
6: /usr/share/vim/vim74/filetype.vim
7: ~/.vimrc
8: /usr/share/vim/vim74/syntax/nosyntax.vim
9: ~/.vim/autoload/pathogen.vim
10: /usr/share/vim/vim74/ftoff.vim
11: /usr/share/vim/vim74/ftplugin.vim
12: /usr/share/vim/vim74/indent.vim
13: ~/.vim/plugin/BufOnly.vim
14: ~/.vim/plugin/scratch.vim
15: ~/.vim/bundle/ZoomWin/plugin/ZoomWinPlugin.vim
16: /usr/share/vim/vim74/plugin/getscriptPlugin.vim
17: /usr/share/vim/vim74/plugin/gzip.vim
18: /usr/share/vim/vim74/plugin/matchparen.vim
19: /usr/share/vim/vim74/plugin/netrwPlugin.vim
20: /usr/share/vim/vim74/plugin/rrhelper.vim
21: /usr/share/vim/vim74/plugin/spellfile.vim
22: /usr/share/vim/vim74/plugin/tarPlugin.vim
23: /usr/share/vim/vim74/plugin/tohtml.vim
24: /usr/share/vim/vim74/plugin/vimballPlugin.vim
25: /usr/share/vim/vim74/plugin/zipPlugin.vim
執行:set rtp
回報:
runtimepath=
~/.vim,
/var/lib/vim/addons,
/usr/share/vim/vimfiles,
/usr/share/vim/vim74,
/usr/share/vim/vimfiles/after,
/var/lib/vim/addons/after,
~/.vim/after
執行:set compatible?
回報nocompatible
執行:set loadplugins?
回報loadplugins
看看:scriptnames
的輸出,看起來好像.vimrc
正在病毒文件之前加載?但是,如果是這種情況,我不知道如何解決這個問題,所以它總是先加載?我在GitHub上與蒂姆教皇(病原的作者)談到它,他建議:
"It's your vimrc's job to load pathogen.vim so the ordering is correct. Confirm how you're invoking pathogen and the directory structure of your Vim directory"
然後,我作出以下澄清說(注:我什麼也沒聽到後面,所以我現在在這裏尋求幫助) ...
我的完整dotfile結構可以在這裏看到:https://github.com/Integralist/dotfiles(技術上它是linux
分支)。
具體來說,我在這裏把它叫做:https://github.com/Integralist/dotfiles/blob/linux/.vimrc#L119-L120
注:這點文件正常工作在我的Mac,它只是因爲加載它們在Linux機器上已經,我注意到有不被病原加載的插件的問題。
頂級樹狀結構可以看到下面......
.
├── .agignore
├── .bashrc
├── .gitconfig
├── .gitignore_global
├── .irssi
├── .tmux.conf
├── .vim
│ ├── .netrwhist
│ ├── autoload
│ │ └── pathogen.vim
│ ├── bundle
│ │ ├── CSApprox
│ │ ├── Dockerfile.vim
│ │ ├── Gist.vim
│ │ ├── Tabmerge
│ │ ├── ZoomWin
│ │ ├── ack.vim
│ │ ├── camelcasemotion
│ │ ├── ctrlp.vim
│ │ ├── emmet-vim
│ │ ├── gruvbox
│ │ ├── html5.vim
│ │ ├── nerdtree
│ │ ├── rainbow_parentheses.vim
│ │ ├── supertab
│ │ ├── syntastic
│ │ ├── tabular
│ │ ├── targets.vim
│ │ ├── textutil.vim
│ │ ├── tomorrow-night-vim
│ │ ├── vim-airline
│ │ ├── vim-bookmarks
│ │ ├── vim-choosewin
│ │ ├── vim-clojure-highlight
│ │ ├── vim-clojure-static
│ │ ├── vim-colors-pencil
│ │ ├── vim-commentary
│ │ ├── vim-cucumber
│ │ ├── vim-dispatch
│ │ ├── vim-endwise
│ │ ├── vim-fireplace
│ │ ├── vim-fugitive
│ │ ├── vim-gitgutter
│ │ ├── vim-haml
│ │ ├── vim-leiningen
│ │ ├── vim-localrc
│ │ ├── vim-markdown
│ │ ├── vim-node
│ │ ├── vim-polyglot
│ │ ├── vim-repeat
│ │ ├── vim-ruby
│ │ ├── vim-sexp
│ │ ├── vim-sexp-mappings-for-regular-people
│ │ ├── vim-surround
│ │ ├── vim-tbone
│ │ ├── webapi-vim
│ │ └── wildfire.vim
│ ├── colors
│ │ ├── Tomorrow-Solarized.vim
│ │ ├── badwolf.vim
│ │ ├── blazer.vim
│ │ ├── flatland.vim
│ │ ├── github.vim
│ │ ├── gruvbox.vim
│ │ ├── kellys.vim
│ │ ├── vividchalk.vim
│ │ └── whitebox.vim
│ └── plugin
│ ├── BufOnly.vim
│ └── scratch.vim
├── .vimrc
我因爲試圖從bundle
目錄中刪除所有的插件,並把背在tomorrow-night-vim
插件文件夾,但仍Vim中無法找到插件,所以當我執行:colorscheme Tomorrow
時,它無法找到該文件(這是希望可能有另一個插件導致問題,並阻止所有其他插件加載 - >抓住那個我知道的吸管)。
下面的輸出是從我的Mac上類似的一組向上運行:scriptnames
:
~/.vimrc
2: /usr/local/Cellar/vim/7.4.335/share/vim/vim74/syntax/syntax.vim
3: /usr/local/Cellar/vim/7.4.335/share/vim/vim74/syntax/synload.vim
4: /usr/local/Cellar/vim/7.4.335/share/vim/vim74/syntax/syncolor.vim
5: /usr/local/Cellar/vim/7.4.335/share/vim/vim74/filetype.vim
6: ~/.vim/autoload/pathogen.vim
7: /usr/local/Cellar/vim/7.4.335/share/vim/vim74/ftoff.vim
8: ~/.vim/bundle/Dockerfile.vim/ftdetect/Dockerfile.vim
9: ~/.vim/bundle/vim-clojure-static/ftdetect/clojure.vim
10: ~/.vim/bundle/vim-cucumber/ftdetect/cucumber.vim
11: ~/.vim/bundle/vim-haml/ftdetect/haml.vim
12: ~/.vim/bundle/vim-markdown/ftdetect/markdown.vim
13: ~/.vim/bundle/vim-node/ftdetect/node.vim
14: ~/.vim/bundle/vim-polyglot/ftdetect/polyglot.vim
15: ~/.vim/bundle/vim-ruby/ftdetect/ruby.vim
16: ~/.vim/bundle/vim-polyglot/after/ftdetect/rspec.vim
17: /usr/local/Cellar/vim/7.4.335/share/vim/vim74/ftplugin.vim
18: /usr/local/Cellar/vim/7.4.335/share/vim/vim74/indent.vim
19: ~/.vim/bundle/tomorrow-night-vim/colors/Tomorrow-Night.vim
20: ~/.vim/plugin/BufOnly.vim
21: ~/.vim/plugin/scratch.vim
22: ~/.vim/bundle/ack.vim/plugin/ack.vim
23: ~/.vim/bundle/camelcasemotion/plugin/camelcasemotion.vim
24: ~/.vim/bundle/CSApprox/plugin/CSApprox.vim
25: ~/.vim/bundle/ctrlp.vim/plugin/ctrlp.vim
26: ~/.vim/bundle/ctrlp.vim/autoload/ctrlp/mrufiles.vim
27: ~/.vim/bundle/emmet-vim/plugin/emmet.vim
28: ~/.vim/bundle/Gist.vim/plugin/gist.vim
29: ~/.vim/bundle/nerdtree/plugin/NERD_tree.vim
30: ~/.vim/bundle/nerdtree/autoload/nerdtree.vim
31: ~/.vim/bundle/nerdtree/lib/nerdtree/path.vim
32: ~/.vim/bundle/nerdtree/lib/nerdtree/menu_controller.vim
確定它看起來像我的插件還沒有被上傳至GitHub上的內容: - /我不知道爲什麼,雖然。我需要弄清楚如何上傳自己爲git repos的文件夾(例如,他們有一個.git文件),然後這將解決我遇到的問題。 – Integralist 2014-09-22 09:07:28
嘗試將第118-120行移動到文件的頂部,*在第1行之前。 – romainl 2014-09-22 09:54:40