From 44eaabc43c0b9cefefbc7de97756d1bce9dae851 Mon Sep 17 00:00:00 2001 From: Asmir A Date: Sun, 9 Jul 2023 12:01:44 +0200 Subject: [PATCH] lua_ls: fix vim global not found --- vimrc.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/vimrc.lua b/vimrc.lua index 492d12a..c8e8236 100644 --- a/vimrc.lua +++ b/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({