I am deciding between using either goneovim vs neovide, both on windows, but each uses the font height differently, so I a wanted to make something like:

if has(goneovim)
    "goneovim specific stuff
elseif has (neovide)
    "neovide specific stuff

So I want to know if that is possible, and if so, how I can get the name of the GUI in vim.


Maybe what you're looking for is the following;

if exists('g:gonvim_running')
    "goneovim specific stuff
elseif exists('g:neovide')
    "neovide specific stuff
  • Welcome to Vi and Vim! How did you find this information? Do those nvim front-ends document that they expose these variables? If so, that would be valuable information to edit in – D. Ben Knoble Oct 25 '20 at 14:28
  • You are absolutely right, this is exactly what I needed! Thanks, it works flawlessly. And out of curiosity, how did you get that information? – kishikaisei Oct 26 '20 at 8:24
  1. Neovim IS NEITHER GVim NOR Vim. Especially, when we talk about ui attachment.

  2. In Neovim ui is implemented using client-server achitecture. That is, one Neovim core could be shared between any number (including zero if running builtin TUI) of external (G)UIs at the same time.

  3. Strictly speaking, you ought to walk through :h nvim_list_uis() and :h nvim_list_chans() to honour item (2), but, if doing it really dirty

:echo nvim_get_chan_info(1).client.name
  • I see what you mean, I tried the nvim_get_chan_info(1).client.name it only works for the default neovim-qt, but not for other implementations, so I guess they are not sending back the data for nvim to capture. So I am assuming that it is impossible at the current state. Thank you for your answer. – kishikaisei Oct 19 '20 at 10:12
  • 1
    @kishikaisei Yes, that information is optional and its availability depends on client implementation. See :h nvim_get_chan_info() and :h nvim_set_client_info(). – Matt Oct 19 '20 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.