4

I have some plugins that it's config use vim-script how can I config plugins that use vim-script with lua for neovim.

for example gruvbox use vim-script I look in docs for lua config but I didn't find any thing, I have to use vim-script to configure it.

1
  • Have you checked nvim lua guide? Commented Oct 9, 2022 at 3:58

1 Answer 1

3

While writing your nvim stuff in lua, the vim object is automatically injected into your code by Neovim. It allows getting and setting vim, plugins and variable related options in lua.

The gruvbox theme requires setting variables in the global scope. You can access the global scope using the vim.g field.

For example to set g:gruvbox_bold to 1, which is true in lua, you need to write

vim.g.gruvbox_bold = true

in your init.lua file.

I recommend you to take a look at this article. https://www.notonlycode.org/neovim-lua-config/. It is short and teaches the basics of using lua in Neovim.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.