开发者

vim plugin command w/o a buffer

开发者 https://www.devze.com 2023-03-26 20:36 出处:网络
I have a problem with many vim commands that come from plugins. They don\'t within an empty buffer. For example :Gstatus from fugitive plugin doesn\'t work when in a new tab/buffer.

I have a problem with many vim commands that come from plugins. They don't within an empty buffer.

For example :Gstatus from fugitive plugin doesn't work when in a new tab/buffer.

The strangest thing though is that initially, just after running vim, it works. i.e. if开发者_JAVA技巧 I just run vim and type :Gstatus it will work. but if before that I do :newtab or :enew it will not work.

The difference that I see that the first open buffer seems to be in a [Rails] mode, and the new ones are not.


These commands work on files and/or directories. When doing :tabnew you don't open a file or a directory. 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.

You could try to :cd to an actual git repository and do :Gstatus there.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号