У меня проблемы с установкой vundle на Vim (Windows 10). Следуя инструкции здесь https://github.com/VundleVim/Vundle.vim, я в основном дохожу до того, что модифицирую свой vimr c. Когда я пытаюсь запустить :PluginInstall
, я получаю вывод, что такой команды нет. Вот мой vimr c, модифицированный:
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
call vundle#end() " required
filetype plugin indent on " required
" Vim with all enhancements
source $VIMRUNTIME/vimrc_example.vim
" Use the internal diff if available.
" Otherwise use the special 'diffexpr' for Windows.
if &diffopt !~# 'internal'
set diffexpr=MyDiff()
endif
function MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
let arg1 = v:fname_in
if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
let arg1 = substitute(arg1, '!', '\!', 'g')
let arg2 = v:fname_new
if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
let arg2 = substitute(arg2, '!', '\!', 'g')
let arg3 = v:fname_out
if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
let arg3 = substitute(arg3, '!', '\!', 'g')
if $VIMRUNTIME =~ ' '
if &sh =~ '\<cmd'
if empty(&shellxquote)
let l:shxq_sav = ''
set shellxquote&
endif
let cmd = '"' . $VIMRUNTIME . '\diff"'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
endif
else
let cmd = $VIMRUNTIME . '\diff'
endif
let cmd = substitute(cmd, '!', '\!', 'g')
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3
if exists('l:shxq_sav')
let &shellxquote=l:shxq_sav
endif
endfunction
set number
set encoding=utf-8
В поисках решения я случайно встретился здесь Vundle - E492: Не команда редактора: PluginInstall этот комментарий:
Это случилось с моей рабочей машиной (Windows), потому что я использовал Cygwin VIM. Проблема заключалась в том, что когда я клонировал Vundle.vim
, он использовал окончания линий в стиле Windows, а плагин Vundle не загружался. Мне пришлось запустить find ~/.vim -type f -iname '*.vim' -exec dos2unix {} \+
, чтобы преобразовать мои файлы в unix окончания строк, прежде чем это сработало.
Это предполагает, что у вас установлено dos2unix
.
Я действительно установил Cygwin и я запускаю windows, но тогда ни предложенное решение не сработало, ни я действительно понял, в чем может быть дело.