janus
janus copied to clipboard
Fugitive commands are not available..
When I try to do a :Gstatus
I get an error: E492: Not an editor command: Gstatus
.
In fact when I do a :G<tab>
none of fugitive's commands are listed.
I am using the latest version of Janus
Are you typing :Gstatus
?
Yes :Gstatus
sorry.
It works well on my system, please verify that Janus is installed correctly (running rake
in the ~/.vim
folder usually does it) if not, verify that you did not disable fugitive in your ~/.vimrc.before
file
@eMxyzptlk I did that already and it still doesn't work...
Could you paste the output of :echo g:janus_disabled_plugins
?
@eMxyzptlk {'pep8': {'reason': 'I don''t use python so I don''t need pep8', 'group': 0, 'path': '/Users/aziz/.vim/janus/vim/tools/pep8'}}
Hmmm seems fugitive is not disabled, that's very weird.. do you happen to have it somewhere in your RUNTIME_PATH ? like from your os package manager ?
I'm on OS X Lion and when I echo $RUNTIME_PATH
from the terminal I get a blank line as output. I don't know if that's good or not. Anyway, I didn't edit my RUNTIME_PATH
, ever.
Well if you're on osx lion, unless you messed with your installation, you won't have another copy of the fugitive plugin, does :echo g:pathogen_disabled
includes fugitive ?
Nope...
Okay well last resort
Backup ~/.janus
, ~/.vimrc.before
, ~/.gvimrc.before
, ~/.vimrc.after
and ~/.gvimrc.after
(don't worry if you do not have any of these files, once backed up, execute the following:
rm -rf ~/.vim* ~/.gvim* ~/.janus
curl -Lo- http://bit.ly/janus-bootstrap | bash
cd ~/.vim
rake
This will reinstall janus for you, do not put the files you backed up now instead check if vim loaded fugitive or not.. if it did, then bring the files you backed up one by one until you isolate the problem
I just tried twice on a vanilla janus distribution and it doesn't work...
The weird thing that I manage to spot is that, first of all, :help fugitive
works, and second of all, if I run :help fugitive
followed by any fugitive command, it kind of works, but not so much; let me explain: the command is found and run but it says that the repo is clean even though it isn't (for :Gstatus
that is)...
I just tried to install vim-fugitive on a vanilla vim and it works fine. The problems definitely comes from janus...
Last update of the day: if I run vim
it works. If I run vim .
it doesn't!!!
Seems to be related to NERDTree. Ran into the same issue with just NERDTree and vim-fugitive on a vanilla vim install.
If you don't use NERDTree, you can disable it and vim-fugitive should work fine.
Add call janus#disable_plugin('nerdtree')
to ~/.vimrc.before
/cc @scrooloose
I can't stop using NERDTree, it's part of my workflow, but using vim
instead of vim .
works for me, for now...
But I won't close this issue because there is clearly something wrong there.
@AzizLight My advise is to change your workflow, navigating through NERDTree is a lot slower than Ctrlp (or good old :edit) because you have to look for something, instead of a couple of keystrokes.. The only and I mean the only use case I have for NERDTree is when I am browsing a codebase that I do not know, NERDTree is better than Finder/Terminal but it is far worse than CtrlP..
As @garybernhardt puts it in his SOME VIM TIPS screencast "The slowest thing you can do, is have to read something, the faster thing you can do, is scan the shape of something but the best thing you could do is to just do it" (Excellent screencast BTW) and that's exactly what CtrlP (although he talk about CommandT but it's basically the same) is, using at least three keystrokes you can get to a file (like <D-t>amcom<CR>
will open app/modela/company.rb
how cool is that right?)
P.S: If you'd like to continue discussing or arguing this topic, please do so on the mailing list
Hey guys,
I have made a change to the nerdtree and sent @tpope a pull request for fugitive that will add fugitive commands to nerdtree buffers.
Not sure if this has been solved for @AzizLight but I'll write my experience since the issue is still officially open.
I thought I had the same problem but then I went through the fugitive docs and it clearly states that you need to have a file that is already in the repo open in the buffer to have access to any of the commands.
What fooled me was that after I staged or added a file to the repo, I still had no access to the commands. This is because fugitive doesn't recognize the file automatically (as testified by the lack of repo name in the status line from fugitive#statusline()
). If you close the buffer and reload it then the commands are available (and the repo shows up in the status line).
This is an annoying but bearable issue, and I think it's with fugitive rather than Janus.
I am experiencing this same issue using Fugitive and NERDtree
This is still a problem now.
I just ran into this problem as well. I love fugitive, but it's much less practical if I have to Google around, find a workaround, and figure out how to implement it before I can use the plugin. I suspect that many would be put off and just decide "it doesn't work."
Relates to Issue #298.
Starting vim with -f parameter also disables all G commands.
Ubuntu's default gvim.desktop launcher executes: gvim -f %F
to handle dropped files. This somehow disables all fugitive commands.
Workaround by changing the launcher command.
Hope this helps.
This is still an issue if running vim . Fugitive seems to work from the NerdTree buffer, but not from any other buffer, however, it splitting into the narrow NerdTree buffer is not very user friendly :)
Solution: Fugitive commands available in all buffers
Fix: Removed -buffer
in fugitive.vim
https://github.com/tpope/vim-fugitive/pull/652
I still have this issue using NerdTree at the same time with fugitive.
I have noticed that there are problems when you vim files that have been soft linked (i.e. ln -s). I have my dotfiles on github and link them to ~ so that I can easily modify them. It's not a big problem because I can just go to the git folder they are stored in and do stuff, but I thought I would bring it up.
An interesting thought would be to make my home dir a git repo and then ignore almost everything in it. :) But it would be nice to Gdiff soft-linked files.
Agree with @archmint I face the same problem. I choose to map !git add %
. I refuse to have a git repo at ~
. Too messy
Strangely enough... What I ended up doing was making an alias for editing all of my most used dot files. So, like... alias vz='f=$(readlink -f $HOME/.bashrc); cd ${f:h}; vim $f; cd - > /dev/null
will go to the homefolder of my bashrc dot file. NOTE THAT IS IN MY ZSHRC HENCE THE ${f: h} (can't do in bash). In my bashrc, I have alias vb=' f=$(readlink -f $HOME/.bashrc); cd $(dirname $f); vim $f; cd - > /dev/null
. I know it's pretty strange, but it suits my needs the best, since I am always adding random things to a lot of different dot files.
Ah yes... I am archmint. Sorry for the confusion. And you can check out my dot files on my repo if ya want. Idk they're kind of useful maybe.
Opened an issue for soft links https://github.com/tpope/vim-fugitive/issues/989
Using the FollowSymlink autocmd causes autocmd fugitive
to not load the buffer commands and b:git_dir
" Follow symlink to open actual file
autocmd BufReadPost * call FollowSymlink(expand('<afile>'))
Symlink Issue 1
- start vim
- open symlink file
- :Gwrite
E492: Not an editor command: Gwrite
Nonsymlink Success
- start vim
- open non-symlink file
- :Gwrite
:Works!
Symlink Issue 2
Opening a nonsymlink file will load the :Gwrite
function, which will then work on the symlink file. However the b:git_dir
isn't loaded so :Gwrite
throws an error
Error detected while processing function <SNR>115_Write[5]..<SNR>115_buffer[6]..<SNR>115_throw:
line 2:
E605: Exception not caught: fugitive: not a git repository: /Volumes/Work/.do/Dotfiles/vimrc
Error detected while processing function <SNR>115_Write:
line 5:
E171: Missing :endif
Workaround is to reload the file after FollowSymlink was executed.
:e
:Gwrite