Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to config neovim-qt #1068

Open
Cruising0904 opened this issue May 5, 2023 · 6 comments
Open

Unable to config neovim-qt #1068

Cruising0904 opened this issue May 5, 2023 · 6 comments

Comments

@Cruising0904
Copy link

In neovim I put gui font it works though
I can't configure from ginit.vim
image
in ginit.vim
image
it gives error like above 'not an editor blah blah' in neovim-qt
I want to config background transparent
image
image

I have looked through docs and issues seems like it does not recognize ginit.vim on my machine.

@jgehrig
Copy link
Collaborator

jgehrig commented May 6, 2023

A few comments, and things to try...

You don't need to include the : in ginit.vim.

Check if :GuiWindowOpacity 0.9 works when run from neovim-qt manually.

Ensure the function GuiWindowOpacity exists in the file /usr/share/nvim-qt/runtime/plugin/nvim_gui_shim.vim.

Ensure ginit.vim is located at ~/.config/nvim/ginit.vim.

Try temporarily removing your dotfiles symlink.

--

If it still doesn't work after all of the above, let me know and we can debug further.

@Cruising0904
Copy link
Author

I am using lazyvim for my config when I launch nvim-qt it gives error first picture
When I remove my dotfiles does not complain though hard to tell if the option is affected, seems like nothing happens
image

image

@kierun
Copy link

kierun commented May 18, 2023

I switched to lazy yesterday and lo and behold, I have the same issue. 💯 happy to blame lazy, but as it is popular, it might be worth getting to the bottom of this. As usual, I am happy to test things.

The commands that do not work are:

√ ; rg Gui ~/.config/nvim/ginit.vim
GuiFont! PragmataProMonoLiga Nerd Font:h8
GuiTabline 0
GuiPopupmenu 0
GuiRenderLigature 1

screenshot

; nvim-qt --version
NVIM-QT v0.2.18.9999
Build type: Release
Compilation: -Wall -Wextra -Wno-unused-parameter -Wunused-variable
Qt Version: 5.15.9
Environment:
  nvim: nvim
  args: --cmd let &rtp.=',/home/usr/bin/../share/nvim-qt/runtime' --cmd set termguicolors
  runtime: /home/usr/bin/../share/nvim-qt/runtime

NVIM v0.10.0-dev-350+gc9f47fca8
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
[…]

I do not have the shim installed…

@kierun
Copy link

kierun commented May 18, 2023

I checked lazy and found this issue, which describes the problem and solution: install the shim.

I added "equalsraf/neovim-gui-shim" to the list of plugins and now everything is fine.

@zacuke
Copy link

zacuke commented Jan 18, 2025

The linked issue suggests that Lazy isn't planning to address this. Would it be possible to integrate a solution like "equalsraf/neovim-gui-shim" or something similar directly into neovim-qt? Alternatively, is there a post-hook or another mechanism that could restore the path if it gets overwritten?

At the very least, it would be helpful to have a message or warning that points us toward a potential solution.

@equalsraf
Copy link
Owner

So it seems lazy clears the rtp somehow. lazy itself provides an option (config.performance.rtp.reset = false) to avoid this problem which is mentioned in both the tickets as the only workaround for this

folke/lazy.nvim#23 (comment)

but the default behavior is to reset the rtp, so whenever lazy is used with nvim-qt the gui plugin is never loaded.

The other fix I've seen in some issues is to manually load the gui shim as a plugin. Which works but it is just doing through the plugin manager what was already being done.

As for a solution on our side

At the very least, it would be helpful to have a message or warning that points us toward a potential solution.

It would. But we have a bit of bootstrapping problem here. The shim is already included with the install, it just can't be loaded through the rtp option in the command line. So the code that would help us warn the user cannot be loaded :D

We also cannot warn too hard and risk annoying the user - in particular when doing remote attachment the shim cannot be loaded and that is actually not an error.

I guess the path forward is to move to a setup where all the shim code is loaded through the api instead of relying on nvim finding it in the filesystem. But this will take a bit of work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants