From c6fd52e0c079302e34aaa7ca401298a9487db39a Mon Sep 17 00:00:00 2001 From: Asmir A Date: Sun, 9 Jul 2023 12:02:21 +0200 Subject: [PATCH] vim: lua_ls fix vim global not found --- home/vimrc.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/home/vimrc.lua b/home/vimrc.lua index 492d12a..c8e8236 100644 --- a/home/vimrc.lua +++ b/home/vimrc.lua @@ -194,6 +194,23 @@ end require('lspconfig').lua_ls.setup({ single_file_support = true, + settings = { + Lua = { + diagnostics = { + globals = { 'vim' }, + }, + runtime = { + version = 'LuaJIT', + path = vim.split(package.path, ';'), + }, + workspace = { + library = { + [vim.fn.expand('$VIMRUNTIME/lua')] = true, + [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true, + }, + }, + }, + }, }) require('lspconfig').verible.setup({