oni icon indicating copy to clipboard operation
oni copied to clipboard

Vim fugitive not working on Oni

Open jamestthompson3 opened this issue 8 years ago • 12 comments

fugitive

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.

jamestthompson3 avatar Jul 30 '18 11:07 jamestthompson3

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.

oni-bot avatar Jul 30 '18 11:07 oni-bot

@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

akinsho avatar Jul 30 '18 12:07 akinsho

It is installed via dein.

jamestthompson3 avatar Jul 30 '18 12:07 jamestthompson3

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

akinsho avatar Jul 30 '18 13:07 akinsho

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.

jamestthompson3 avatar Jul 30 '18 14:07 jamestthompson3

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

akinsho avatar Jul 30 '18 14:07 akinsho

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 avatar Jul 30 '18 17:07 jamestthompson3

@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?

badosu avatar Aug 14 '18 19:08 badosu

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.

jamestthompson3 avatar Aug 15 '18 07:08 jamestthompson3

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 avatar Aug 20 '18 14:08 jamestthompson3

@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, required

filetype 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 "oni.loadInitVim": true, // Load user's init.vim "oni.useDefaultConfig": false, // Do not load Oni's init.vim "ui.colorscheme": "n/a", // Load init.vim colorscheme, remove this line if wants Oni's default "autoClosingPairs.enabled": false, // disable autoclosing pairs "commandline.mode": false, // Do not override commandline UI "wildmenu.mode": false, // Do not override wildmenu UI, "learning.enabled": false, // Turn off learning pane "achievements.enabled": false, // Turn off achievements tracking / UX "editor.textMateHighlighting.enabled": false, // Use vim syntax highlighting "editor.typingPrediction": false, // Wait for vim's confirmed typed characters, avoid edge cases "editor.renderer": "webgl", "sidebar.default.open": false, }

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

badosu avatar Aug 20 '18 16:08 badosu

Simplifying my vim configuration did the trick, seems to be working more reliably now. Thanks everyone!

jamestthompson3 avatar Aug 21 '18 06:08 jamestthompson3