ghost-text-vim icon indicating copy to clipboard operation
ghost-text-vim copied to clipboard

use with neovim

Open ysolis opened this issue 7 years ago • 10 comments

Hi, i like to test this, but I use now neovim, not vim 7.4/8.0.

I imagine that you use vim --remote capability and this with neovim is retired, instead you can use a plugin (nvim-remote) to get back this functionality, but we will need to change the executable to launch.

ysolis avatar Aug 23 '17 02:08 ysolis

Should be easy enough. Which executable should be used when you launch a new window - is there a gvim? gnvim? And then simply nvr --remote ... for the remote commands?

falstro avatar Aug 31 '17 19:08 falstro

no command gives to you an "external" neovim GUI. "nvim" command call directly neovim in shell. I have customized my shell (zsh) to have an 'neovim" executable that launch nvim + gtk GUI.

My idea will be that we have and ENV var that can launch the editor (this will works with Firefox, Chrome, ...) and if the ENV var is not defined, by default, go to "gvim" executable.

ysolis avatar Sep 01 '17 01:09 ysolis

I very nearly got this working with gonvim via neovim-remote but got stuck on what seems to be a variation of #3.

The only changes are here:

diff --git a/ghost-text-server.tcl b/ghost-text-server.tcl
index c3affa9..a5f068f 100755
--- a/ghost-text-server.tcl
+++ b/ghost-text-server.tcl
@@ -17,11 +17,11 @@ foreach opt $::argv {
   }
 }
 
-proc vim-send {name msg} { exec gvim --servername $name --remote-send $msg }
-proc vim-expr {name expr} { exec gvim --servername $name --remote-expr $expr }
+proc vim-send {name msg} { exec nvr --servername $name --remote-send $msg }
+proc vim-expr {name expr} { exec nvr --servername $name --remote-expr $expr }
 
 proc vim-launch {name} {
-    exec gvim --servername $name &
+    exec nvr --servername $name --remote-tab-silent &
 
     while {[incr attempts] < 10 && [catch {vim-expr $chan changenr()}]} {
       after 250

Then launch the daemon with an environment variable that nvr knows to use to lanch the actual instance: NVR_CMD=gonvim ./ghost-text-server.tcl

alerque avatar Oct 11 '17 11:10 alerque

Hej, any news on this ? I'd be highly interested in using neovim as well!

varac avatar Nov 09 '17 12:11 varac

I don't use neovim, and it appears neovim-remote isn't available as a debian package, so I can't really test anything. I've added options to parameterize the launcher, but I'm guessing that's insufficient.

falstro avatar Nov 19 '17 11:11 falstro

@falstro Thanks for giving this some attention. I'm happy to test and help do any Neovim specific work than needs to be done. At this point I think the real issue here is whatever feedback loop is causing #3. Neovim doesn't seem to be the cause of that as I'm seeing the the same behavior as Gvim.

alerque avatar Nov 20 '17 08:11 alerque

Unfortunately, this appears to be an issue with the browser plugin (there's a link to the browser plugin issue in #3, I just left it open so I don't forget to check it once the other closes), I have never personally observed this, but the fact that it we see multiple connections from the browser it does work as intended.

falstro avatar Nov 20 '17 10:11 falstro

For reference, the upstream issue is GhostText #95.

alerque avatar Nov 20 '17 14:11 alerque

So how should I configure it to be able to use it with neovim and neovim-remote ?

aemonge avatar Aug 09 '18 08:08 aemonge

@aemonge et all: I was never able to get this plugin to work with Neovim. You can use vim-ghost instead.

alerque avatar Aug 09 '18 11:08 alerque