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

Can i use 'ginit.lua' to config my nvim-qt? #1128

Closed
xing-uestc opened this issue Oct 25, 2024 · 2 comments
Closed

Can i use 'ginit.lua' to config my nvim-qt? #1128

xing-uestc opened this issue Oct 25, 2024 · 2 comments

Comments

@xing-uestc
Copy link

it seems like that the lua files is not available for nvim-qt, but my old configuaration files are all written by lua. What should I do to next?

@justinmk
Copy link
Contributor

justinmk commented Oct 25, 2024

it seems like that the lua files is not available for nvim-qt

? init.lua is supported. What version of Nvim are you using with nvim-qt ?

Sounds like you have a 'runtimepath' configuration issue.

@equalsraf
Copy link
Owner

Short answer is no we do not plan to support a ginit.lua file. Lua support came after the UI, and ginit.vim was a legacy file from Vim so we never supported a ginit.lua file.

However you can configure the UI from your init.lua. For example here is my config to apply settings to nvim-qt only

-- Load UI settings when the UI attaches
vim.api.nvim_create_autocmd({ "UIEnter" }, {
  callback = function()
	  local chanid = vim.v.event.chan
	  -- defer code here, otherwise get chan info will not return
	  -- the data we need to determine the UI
	  vim.defer_fn(function()
		  local name = vim.api.nvim_get_chan_info(chanid).client.name
		  --print('UI attached', name, chanid)
		  if name == 'nvim-qt' then
                          -- nvim-qt specific settings

			  -- Disable render attr
			  vim.fn.execute('GuiRenderFontAttr 0')
			  -- enable GUI clipboard 
			  vim.api.nvim_call_function('GuiClipboard', {})
		  end
	  end, 0)
  end
})

Of course you can also change that code to load a ginit.lua file.

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

3 participants