2

I am in the process of converting my .vimrc to init.lua. Several of my lines end up containing vimscript inside a call to vim.cmd, such as

vim.cmd("highlight Normal guibg=none ctermbg=none")
vim.cmd("highlight EndOfBuffer guibg=none ctermbg=none")
vim.cmd("highlight cursorline cterm=none ctermbg=236")
vim.cmd("highlight cursorcolumn cterm=none ctermbg=236")

vim.cmd("syntax on")
vim.cmd("filetype on")

How can I find the corresponding lua functions to call for these features?

1
  • Probably in the :help
    – D. Ben Knoble
    Commented Nov 20, 2022 at 20:15

1 Answer 1

2

For highlight command, you can use function nvim_set_hl() instead:

vim.api.nvim_set_hl(0, 'Normal', {fg = '#00ffff', bg = '#ff0000'})

There is not equivalent function for syntax on and filetype on in lua.

Your Answer

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

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