如何解决Gvim / Git插件错误E492:不是编辑器命令:GitStatus
首先,我认为这是我安装东西的问题,而不是软件包的问题。
在Windows上,我从下载了Vim的Git插件的zip文件。 https://github.com/WolfgangMehner/git-support
该zip文件名为git-support-master.zip,并具有以下树:
git-support-master\doc
git-support-master\git-support
git-support-master\plugin
git-support-master\project
git-support-master\syntax
git-support-master\README.md
我的$ HOME是c:\ Users \ myuser 而且我有c:\ Users \ myuser \ vimfiles。
我将说明解释为意味着我应该能够解压缩zip文件,以便上面zip中的doc文件进入上面的doc目录。为此,我必须提取修剪 路径中的git-support-master。
~ vimfiles/
~ autoload/
pathogen.vim
~ bundle/
+ delimitMate/
+ nerdtree/
~ doc/
gitsupport.txt
tags
~ git-support/
~ doc/
ChangeLog
~ git-doc/
commands.txt
compile_changelog.lua
help_topics.txt
+ rc/
README.md
+ pack/typescript/start/typescript-vim/
~ plugin/
git-support.vim
~ project/
release.lua
+ syntax/
README.md
vimrc
我的.vimrc是:
execute pathogen#infect()
syntax on
filetype plugin indent on
set nocompatible
let $ORACLE_HOME='C:\app\oracle\product\12.1.0\client'
set expandtab
nmap <C-n> :NERDTreeToggle<CR>
set autoindent
set sw=4
set clipboard=unnamed
set nu
set noerrorbells
set nohlsearch
set vb t_vb=
"if $OSTYPE=="cygwin"
" set SHELL=C:\programs\cygwin\bin\bash.exe
"endif
"
"let g:Git_Executable = 'LANG=en_US git'
let g:Git_Executable = 'C:\programs\cygwin\bin\git.exe'
在git菜单中运行内容时,出现如下错误:
E492: Not an editor command: GitStatus
但是,它可以找到插件支持。
上面的Git可执行文件确实存在,是的,我正在使用它的Cygwin版本。
我运行了注释中提到的scriptnames命令,但是无法将其捕获到暂存缓冲区中,但是确实看到它没有加载任何与Git插件相关的内容。它加载了.vimrc,病原体vim插件。
我尝试了:GitHelp,它给了我:
usage: git [--version] [--help] [-C <path>] [-c <name>=<value>]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
<command> [<args>]
These are common Git commands used in various situations:
start a working area (see also: git help tutorial)
clone Clone a repository into a new directory
init Create an empty Git repository or reinitialize an existing one
work on the current change (see also: git help everyday)
add Add file contents to the index
mv Move or rename a file,a directory,or a symlink
restore Restore working tree files
rm Remove files from the working tree and from the index
sparse-checkout Initialize and modify the sparse-checkout
examine the history and state (see also: git help revisions)
bisect Use binary search to find the commit that introduced a bug
diff Show changes between commits,commit and working tree,etc
grep Print lines matching a pattern
log Show commit logs
show Show various types of objects
status Show the working tree status
grow,mark and tweak your common history
branch List,create,or delete branches
commit Record changes to the repository
merge Join two or more development histories together
rebase Reapply commits on top of another base tip
reset Reset current HEAD to the specified state
switch Switch branches
tag Create,list,delete or verify a tag object signed with GPG
collaborate (see also: git help workflows)
fetch Download objects and refs from another repository
pull Fetch from and integrate with another repository or a local branch
push Update remote refs along with associated objects
'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
See 'git help git' for an overview of the system.
解决方法
您似乎在混合三种不同的插件处理方法:
~ vimfiles/
~ autoload/
pathogen.vim
~ bundle/
表明您正在使用病原菌
+ pack/typescript/start/typescript-vim/
表明您正在使用新的:help package
功能,
我将说明解释为意味着我应该能够解压缩zip文件,以便上面zip中的doc文件进入上面的doc目录。为此,我必须从路径中提取修剪git-support-master。
表明您正在尝试以“经典”方式安装该插件。
您应该选择一种方法并坚持下去...
- 通常认为经典方式比较凌乱,因此您应该避免使用它。
- 如果您仅使用最新的Vim,则可能应将Pathogen视为已弃用,并选择新的“打包”方法(如果您不介意自己管理插件)或使用像vim-这样的功能强大的插件管理器,插头。
如果在 CMP 面板中输入错误命令后显示,则只需按 esc 然后再次输入您要运行的命令。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。