【发布时间】:2020-03-07 01:47:03
【问题描述】:
我在 Vim (Windows 10) 上安装 vundle 时遇到问题。按照此处https://github.com/VundleVim/Vundle.vim 的说明,我基本上可以修改我的vimrc。当我尝试运行:PluginInstall 时,我得到的输出是没有这样的命令。这是我的 vimrc,已修改:
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: Not an editor command: PluginInstall这个评论:
这发生在我的工作机器 (Windows) 上,因为我使用的是 Cygwin VIM。问题是,当我克隆
Vundle.vim时,它使用了 Windows 样式的行尾,并且 Vundle 插件没有加载。我必须运行find ~/.vim -type f -iname '*.vim' -exec dos2unix {} \+才能将我的文件转换为 unix 行尾,然后才能正常工作。这假设您已安装
dos2unix。
我确实已经安装了 Cygwin 并运行了 windows,但是所提出的解决方案也没有奏效,我也真的不明白可能是什么问题。
【问题讨论】: