[英]vim plugin command w/o a buffer
I have a problem with many vim commands that come from plugins. 我有许多来自插件的vim命令有问题。 They don't within an empty buffer.
它们不在空缓冲区中。
For example :Gstatus from fugitive plugin doesn't work when in a new tab/buffer. 例如:在新标签页/缓冲区中,逃犯插件的:Gstatus无法正常工作。
The strangest thing though is that initially, just after running vim, it works. 但是,最奇怪的是,在运行vim之后,它开始工作。 ie if I just run vim and type :Gstatus it will work.
即,如果我只运行vim并输入:Gstatus,它将起作用。 but if before that I do :newtab or :enew it will not work.
但是,如果在那之前我做:newtab或:enew它将无法工作。
The difference that I see that the first open buffer seems to be in a [Rails] mode, and the new ones are not. 我看到的第一个打开缓冲区似乎是在[Rails]模式下,而新缓冲区不是。
These commands work on files and/or directories. 这些命令适用于文件和/或目录。 When doing
:tabnew
you don't open a file or a directory. 当
:tabnew
您不会打开文件或目录。 Since fugitive is only a (nice) wrapper around git
, doing :Gstatus
is like doing $ git status
in your "Pictures" folder: it's not a git repository so git does nothing. 由于逃犯只是
git
一个(不错的)包装器,所以:Gstatus
就像在“ Pictures”文件夹中执行$ git status
一样:它不是一个git存储库,所以git不会执行任何操作。
You could try to :cd
to an actual git repository and do :Gstatus
there. 您可以尝试
:cd
到实际的git仓库,然后在:Gstatus
执行:Gstatus
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.