2011-12-09 59 views
15

您好我一直在嘗試在ubuntu上配置vim。Vim vundle colorschemes - vimrc

所有包似乎安裝正常。但是,如果通過vundle安裝colorscheme,然後使用colorscheme名稱,它似乎無法找到該方案。

我試圖安裝railscasts,solarized和desert-warm,但都未能加載。

這是我的.vimrc我做錯了什麼?

set nocompatible    " be iMproved 
filetype off     " required! 

colorscheme desert-warm 

" next tab 
map <F7> :tabn  
" previous tab 
map <F8> :tabp 
" Close Tab abd save 
map <F9> ZZ 
" open and edit file 
map <F6> :tabedit 

set rtp+=~/.vim/bundle/vundle/ 
call vundle#rc() 

" let Vundle manage Vundle 
" required! 
Bundle 'gmarik/vundle' 

" My Bundles here: 
" 
" original repos on github 
Bundle 'tpope/vim-fugitive' 
Bundle 'Lokaltog/vim-easymotion' 
Bundle 'rstacruz/sparkup', {'rtp': 'vim/'} 
Bundle 'tpope/vim-rails.git' 
Bundle 'desert-warm-256' 
" vim-scripts repos 

Bundle 'L9' 
Bundle 'FuzzyFinder' 
" non github repos 
Bundle 'git://git.wincent.com/command-t.git' 
Bundle 'https://github.com/vim-scripts/perl-support.vim.git' 
Bundle 'https://github.com/Raimondi/delimitMate.git' 
Bundle 'https://github.com/altercation/vim-colors-solarized.git' 
Bundle 'https://github.com/jpo/vim-railscasts-theme.git' 
" ... 

filetype plugin indent on  " required! 
" 
" Brief help 
" :BundleList   - list configured bundles 
" :BundleInstall(!) - install(update) bundles 
" :BundleSearch(!) foo - search(or refresh cache first) for foo 
" :BundleClean(!)  - confirm(or auto-approve) removal of unused bundles 
" 
" see :h vundle for more details or wiki for FAQ 
" NOTE: comments after Bundle command are not allowed.. 

回答

12

嘗試將colorscheme調用移動到文件末尾。

此外,您示例中的配色方案名稱不適用於我 - 它應該是colorscheme desert-warm-256。要查看當前安裝的配色方案列表,請嘗試以交互方式輸入:colorscheme <TAB>

+0

謝謝,小費真的很有用。 –

0

colorscheme desert-warm一定要來Bundle 'desert-warm-256'後,因爲它是捆綁命令,增加了事情的路徑:

Bundle 'desert-warm-256' 
colorscheme desert-warm 

來源:same question on GitHub issue

注:Vundle最近(2014年3月18日)交換使用Plugin代替Bundle,所以你git pull後,這將是:

Plugin 'desert-warm-256' 
colorscheme desert-warm 
6

我認爲這個問題的答案是,有在原始海報的.vimrc中沒有call vundle#end()syntax on

call vundle#end()之後的任何地方添加這兩行,例如colorscheme solarized行就可以解決問題。

+0

謝謝,在vundle#()解決了我的問題之後加入了配色方案line – mko

+0

我相信vundle的早期版本不需要對'vundle#end()'進行此調用。在新機器上執行vundle的git克隆時,我不得不添加此項。看例子.vimrc [link](https://github.com/gmarik/Vundle.vim#quick-start) – MrQBerrt

0

你應該在插件行後寫上你的「colorsheme desert bla bla」行。因爲Vundle首先需要安裝這個顏色插件,並且之後才能使用它。對不起,我很累英語。