daa84 / neovim-gtk

gtk ui for neovim
GNU General Public License v3.0
717 stars 56 forks source link

Support --server option #21

Open unclechu opened 6 years ago

unclechu commented 6 years ago

As in https://github.com/equalsraf/neovim-qt it would be cool to have this feature when you're able to start headless neovim-daemon and just connect to specific socket with GUI in any time, connect again you just closed GUI window and other useful stuff.

daa84 commented 6 years ago

Looks like simple task :smile:

unclechu commented 6 years ago

Maybe additional info will help.

An example how to start "headless" neovim server:

env NVIM_LISTEN_ADDRESS="$HOME/.vim-server-socket-file-that-will-be-created" nvim --headless

An example how to connect to this neovim server with neovim-qt (can be attached and detached multiple times):

nvim-qt --server="$HOME/.vim-server-socket-file-that-will-be-created"
unclechu commented 6 years ago

I personally have this helper script to start neovim daemon: https://github.com/unclechu/neovimrc/blob/40c6237f0ca30754f6254c19e7a7122aff32039d/apps/nvimd And I start new daemon by command like this:

nvimd some-name

And then I can copy-paste socket path from this script output:

Neovim server socket file path: /tmp/unclechu-nvim-some-name
Neovim binary: nvim
daa84 commented 6 years ago

This became more complicated due to functionality changes. Gui file browser does not support remote connection. Also Some settings passed to nvim at start (g:GtkGuiLoaded, neovim runtime path and plugins list).

unclechu commented 6 years ago

Sad, but for me it would be okay to get it with extra features disabled (such as file browser) when working in this mode. I'm personally would be really happy to see this feature working.

shaform commented 5 years ago

+1 for this feature. I think the coolest part is that this enables us to connect to nvim sessions in remote servers via ssh. By doing so we are no longer being restricted by text-based terminal using using remote servers.

unclechu commented 5 years ago

I just found this commit: https://github.com/bkoropoff/neovim-gtk/commit/41b6a45eecf74cf0b4d44faa1e85512efcbd3f4e It seems that person was trying to implement it (I personally haven't tested this yet).

daa84 commented 5 years ago

yes, good starting point to implement server functionality. But some "local" logic was removed.

unclechu commented 5 years ago

I'm personally okay with that local logic being removed since I personally don't use any of those features, only ligatures, font size changing, I turn off all the GUI panels. But I really need that external server feature. I really like ligatures support, but I really want my session to live when I accidentally close the window, so now I'm using neovim just inside tmux to make it work this way, giving up ligatures. I hope someday it will work in neovim-gtk, I just wish it would happen earlier than I find enough free time to implement it by myself.