
我已經在我的 ubuntu 機器上安裝了 vundle,但是當我載入 vim 時,沒有任何插件載入。我的 vimrc:
runtime! debian.vim
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
"set rtp+=~/.vim/bundle
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'reedes/vim-thematic'
Plugin 'bling/vim-airline'
" >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - list configured plugins
" :PluginInstall(!) - install (update) plugins
" :PluginSearch(!) foo - search (or refresh cache first) for foo
" :PluginClean(!) - confirm (or auto-approve) removal of unused plugins
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
" """""""""""""""""""""""""""""""""""""ORIGINAL STUFF BELOW"""""""
" All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by
" the call to :runtime you can find below. If you wish to change any of those
" settings, you should do it in this file (/etc/vim/vimrc), since debian.vim
" will be overwritten everytime an upgrade of the vim packages is performed.
" It is recommended to make changes after sourcing debian.vim since it alters
" the value of the 'compatible' option.
" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
" runtime! debian.vim
" Uncomment the next line to make Vim more Vi-compatible
" NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous
" options, so any other options should be set AFTER setting 'compatible'.
"set compatible
" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
"if has("syntax")
syntax on
set number
set ruler
"endif
" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
"set background=dark
" Uncomment the following to have Vim jump to the last position when
" reopening a file
"if has("autocmd")
" au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
"endif
" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
"if has("autocmd")
" filetype plugin indent on
"endif
" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
"set showcmd " Show (partial) command in status line.
"set showmatch " Show matching brackets.
"set ignorecase " Do case insensitive matching
"set smartcase " Do smart case matching
"set incsearch " Incremental search
"set autowrite " Automatically save before commands like :next and :make
"set hidden " Hide buffers when they are abandoned
"set mouse=a " Enable mouse usage (all modes)
" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif
:PluginList 輸出...
" My Plugins
Plugin 'gmarik/Vundle.vim'
Plugin 'reedes/vim-thematic'
Plugin 'bling/vim-airline'
我沒有更改任何其他設置,這是我第一次嘗試使用 Vim 插件。
答案1
永遠不要在
/etc/vim
因為 Vim 遵循嚴格的載入順序,弄亂預設檔和目錄會使 Vim 不穩定。你做的一些事情可能會起作用,有些可能不會……這只是你和你的運氣。
因為後續升級將覆蓋您的部分或全部更改,使它們變得毫無意義。
因為這是習慣和良好的實踐每一個作業系統——而且……在現實生活中——要做你的配置在你的
$HOME
。
你必須創造
~/.vim/
和~/.vimrc
你自己。因為它行為良好,Vim 不這樣做任何事物當您
$HOME
安裝時。這是你的負責建立客製化所需的檔案和目錄:$ cd $ mkdir .vim $ touch .vimrc
此時,您應該有一個空
~/.vim
目錄和一個空~/.vimrc
檔案。您似乎已經有一個~/.vim/
目錄,因此可以跳過該步驟。恢復
/etc/vim
到原始狀態。刪除您新增的任何內容
/etc/vim
。如果不確定,卸載並重新安裝 vim-gnome 或 vim-gtk 軟體包應該會有所幫助。重做 中的所有配置
$HOME
。如果您堅持使用 Vundle,那麼您
~/.vimrc
應該如下所示:filetype off set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() Plugin 'gmarik/Vundle.vim' Plugin 'reedes/vim-thematic' Plugin 'bling/vim-airline' call vundle#end() filetype plugin indent on
實際安裝你的插件。
將你的內容寫入
~/.vimrc
磁碟並退出 Vim::wq
並下達以下命令:
$ vim +PluginInstall
作為一個新的Vim 用戶,你應該找到更有效的方式來花費你的時間和腦細胞,而不是使用類似的無意義的插件管理器來搞亂你試圖安裝的無意義的插件,特別是如果你對UNIX 指令沒有很好的了解的話-線。以下是不完整的建議清單:
- 更熟悉命令列和 UNIX 的一般方式,
- 至少關注
$ vimtutor
幾次, - 閱讀前 30 行左右
:help
並將它們牢記在心,因為它們是您將學到的最有用的 Vim 命令, - 至少通讀
:help usr_01.txt
一下:help usr_08.txt
。
在您對整個事情感到更加滿意之前,我建議您遠離插件(以及不必要的插件管理器),以便您可以專注於 Vim 本身。