Vim Vundle,不是编辑器命令



我在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:不是编辑器命令:PluginInstall这个注释:

这发生在我的工作机器(Windows(上,因为我使用的是Cygwin VIM。问题是,当我克隆Vundle.vim时,它使用了Windows风格的行尾,而Vundle插件没有加载。我必须运行find ~/.vim -type f -iname '*.vim' -exec dos2unix {} +将我的文件转换为unix行尾,然后它才能工作。

这假设您安装了dos2unix

我确实安装了Cygwin,并运行了windows,但后来提出的解决方案都不起作用,我也不知道会发生什么。

这个问题与cygwin有关,因为git和cygwin将以不同的方式解释路径,我做到了:

$ git clone https://github.com/VundleVim/Vundle.vim.git /cygwin64/home/USERNAME/.vim/bundle/Vundle.vim 

然后在vimrc而不是中

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

我放了这个

set rtp+=c:/cygwin64/home/USERNAME/.vim/bundle/Vundle.vim/ call vundle#begin('c:/cygwin64/home/USERNAME/.vim/bundle/')

您的windows机器和路径上是否安装了curlgit(不在cygwin中(?您应该能够从命令和提示符中键入这两种类型,并看到一些输出。

wiki将git和curl指定为Windows上Vundle的要求。

最新更新