
Я установил vundle на свой Ubuntu Box, но когда я загружаю 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.