Vim fugitive not working on Oni

Oni Version: 0.3.6 Neovim Version (Linux only): Operating System: Windows 10
Issue:
When running a vim-fugitive command such as Gstatus in neovim, everything works as expected, however in oni, the not an editor command error appears. I know that the plugin is being loaded correctly because :help fugitive brings up the manual page for the plugin.
Expected behavior:
Commands such as Gblame, Gstatus, etc. should correctly execute and bring up the status, blame, etc for the given project.
Actual behavior:
Errors out with message: E492: Not an editor command: Gstatus
Steps to reproduce: Load config open any project with git version control and run any vim-fugitive command.
Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.
@jamestthompson3 thanks for checking out Oni and posting the issue. I currently rely on fugitive and use it in oni although I haven't encountered this error, the error aka E492 comes from neovim and we dont interact with it (fugitive or rather we dont intentionally) although it might be a question of how fugitive is setup on your machine, can I ask where is it installed via vim-plug etc. or is it in /.config/oni/plugins/ ?
EDIT: sorry just noted the link to your config will take alook
It is installed via dein.
We've had an issue somewhere regarding some plugins and oni in dein and I believe Shougo the guy behind dein released a fix the issue was https://github.com/onivim/oni/issues/1163 and one of the solutions someone else
posted was
if !exists("g:gui_oni")
call dein#save_state()
endif
can you see if that works or if upgrading dein changes anything
It just started working, I haven't done anything to modify oni or my vim config... I will try your solution and see if it becomes more stable.
Edit: Added that if statement and reloaded Oni, it stopped working. Removed the if statement and reloaded Oni, it stopped working again.
Is there a way to clear dein state could be that you have an old dein state saved? that precedes the update? I think dein caches the vim rtp which means that the rtp it uses doesn't match oni's for the nvim instance it spawns I'm not entirely clear on what the original issue was with dein
I checked the issue you mentioned. I have tried the following:
-cleared the dein state, updated remote plugins.
-restarted oni and ran dein#update()
-deleted all plugins and ran a clean dein#install()
Nothing worked. Then after a while of using oni without fugitive working, it worked again, but then I closed my session, and when I opened oni again, fugitive is broken again.
@jamestthompson3 I use fugitive with Oni daily and the error message you received is very common, usually the cause is that the current buffer is not on a file inside a git tree.
Can you confirm that it happens when editing a file controlled by git?
Can confirm. The fugitive support has continued to be off and on in the same directory. Sometimes when I start oni, it works as expected, other times, it doesn't.
I've noticed that this on again, off again pattern is present in other parts of oni, most notably the completion and LSP. Without any other completion or LSP plugins loaded ( only relying on what is available in config.tsx ), it just stops working after a few minutes.
edit: All things considered, Oni is still my daily editor. I think it is better than pretty much everything else and I would be happy to try and fix any of these issues if someone could point me in the right direction.
@jamestthompson3 I've been using fugitive with Oni for a year and never had any issue, I am not sure how to reproduce your error.
This is a very slim config, with most added functionality turned off. Perhaps you could give it a shot (or use it to try a different plugin installation method).
init.vim
set nocompatible " be iMproved, requiredfiletype off " required
set number set noswapfile set smartcase
" Turn off statusbar, because it is externalized set noshowmode set noruler set laststatus=0 set noshowcmd
" Enable GUI mouse behavior set mouse=a
set list set listchars=trail:·
set diffopt+=vertical
" set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-fugitive' Plugin 'tpope/vim-unimpaired'
call vundle#end() " required filetype plugin indent on " required
config.tsx
import * as React from "react" import * as Oni from "oni-api"export const activate = (oni: Oni.Plugin.Api) => { }
export const deactivate = (oni: Oni.Plugin.Api) => { }
export const configuration = {
activate,
deactivate,
"oni.hideMenu": true, // Hide default menu, can be opened with
Installation
Run:
mkdir -P ~/.vim/bundle git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
Open Oni and run :PluginInstall Restart Oni
Simplifying my vim configuration did the trick, seems to be working more reliably now. Thanks everyone!