How do I call a Lua function or evaluate a Lua expression from within Vimscript in Neovim?
luaeval('lua_expression')
When you have existing Vimscript code that needs to reach into Neovim's Lua ecosystem, luaeval() is the bridge.
luaeval('lua_expression')
When you have existing Vimscript code that needs to reach into Neovim's Lua ecosystem, luaeval() is the bridge.
vim.api.nvim_create_namespace('my_plugin')
Neovim's extmark system (for highlights, virtual text, and diagnostics) uses namespaces to group related marks.
vim.wo.number = true / vim.bo.tabstop = 2
Neovim's Lua API exposes three namespaces for setting options with the correct scope: vim.
vim.tbl_deep_extend('force', defaults, overrides)
vim.
vim.print()
vim.
vim.system()
vim.
vim.api.nvim_set_hl(0, 'Normal', {bg='NONE'})
By default, Neovim paints a solid background color defined by the active colorscheme.
config #neovim #lua #config #highlight #colorscheme #transparency
vim.defer_fn()
vim.
vim.ui.select()
Neovim exposes vim.
vim.ui.open()
vim.
:lua = {expression}
In Neovim, :lua = expr is a shorthand that evaluates a Lua expression and pretty-prints the result using vim.
vim.fs.root()
vim.
vim.filetype.add()
vim.
vim.lsp.enable('server-name')
vim.
vim.lsp.config('server', { cmd = {...}, root_markers = {...}, filetypes = {...} })
Neovim 0.
vim.opt
Neovim's vim.
:lua {code}
Neovim's :lua command lets you run arbitrary Lua code inline from the command line.
command-line #command-line #lua #neovim #vimscript #advanced
vim.api.nvim_create_user_command()
Neovim's Lua API provides vim.
vim.opt.option:append(value)
Neovim's vim.