From 4adc57a365aa52ff5d4509fb6b09fc54878d9342 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 5 Dec 2021 19:24:37 +0100 Subject: Added lua lsp --- config/nvim/lua/plugins.lua | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index dca67fb..72ef03d 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -11,7 +11,7 @@ return require('packer').startup(function() -- nvim lsp configuration use { 'neovim/nvim-lspconfig', - ft = {'rust', 'python', 'c', 'cpp'}, + ft = {'rust', 'python', 'c', 'cpp', 'lua'}, config = function() local on_attach = function(client, bufnr) local opts = { noremap = true, silent = true } @@ -30,6 +30,31 @@ return require('packer').startup(function() lspconfig.pylsp.setup { on_attach = on_attach } -- rust_analyzer lspconfig.rust_analyzer.setup { on_attach = on_attach } + -- package lua-language-server on ArchLinux + lspconfig.sumneko_lua.setup { + on_attach = on_attach , + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT', + -- Setup your lua path + path = vim.split(package.path, ';'), + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = {'vim'}, + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = { + [vim.fn.expand('$VIMRUNTIME/lua')] = true, + [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true, + }, + }, + } + }, + } vim.diagnostic.config { signs = false, update_in_insert = false, -- cgit