Closed unclechu closed 5 years ago
I'd like to detect if it's neovim-gtk is running or other GUI in my ginit.vim, is there any way to do so?
Yep, like this:
" NeovimGtk
if exists('g:GtkGuiLoaded')
" Use GTK clipboard
let g:GuiInternalClipboard = 1
" Disable native popup an use vim one instead
call rpcnotify(1, 'Gui', 'Option', 'Popupmenu', 0)
endif
@wezm Is this working only for neovim-gtk? Any chance it could clash with other GUI implementations?
@wezm Thanks, it works for me for now. But I personally think this hack isn't safe and robust one. I'd like to explicitly detect if it's exactly neovim-gtk.
@wezm Thanks, it works for me for now. But I personally think this hack isn't safe and robust one. I'd like to explicitly detect if it's exactly neovim-gtk.
set g:GtkGuiLoaded
at start exactly for this purpose
Okay, I'm taking it as absolutely unique for neovim-gtk and closing this issue as solved.
I'd like to detect if it's neovim-gtk is running or other GUI in my
ginit.vim
, is there any way to do so?neovim-gtk uses GUI font setting format which is different than for neovim-qt, so if I use same
ginit.vim
for both neovim-gtk and neovim-qt I'm getting errors pushed back from GUI without ability to catch it. To avoid that I could detect if it's neovim-gtk to run one command and another for other GUIs.See my
ginit.vim
: https://github.com/unclechu/neovimrc/blob/f1d41a0/ginit.vim#L26-L38