Add lua language server for LSP

This commit is contained in:
flyingscorpio@clevo 2022-08-02 14:12:52 +02:00
parent 69e14f0422
commit 6d39ae8ac1
4 changed files with 29 additions and 1 deletions

View file

@ -65,7 +65,7 @@ vim.api.nvim_create_autocmd("FileType", {
group = group
})
vim.api.nvim_create_autocmd("FileType", {
pattern = "vhdl",
pattern = { "lua", "vhdl" },
command = "setlocal shiftwidth=2 tabstop=2 softtabstop=2",
group = group
})

View file

@ -0,0 +1,23 @@
-- LSP Server for Lua
require'lspconfig'.sumneko_lua.setup {
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = 'LuaJIT',
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = {'vim'},
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
},
},
}

View file

@ -1,3 +1,6 @@
-- LSP Servers
require('lsp.lua')
-- NERDTree
vim.g.NERDTreeIgnore = { '^__pycache__$', '\\.pyc', '\\~$' }
vim.keymap.set('n', '<leader>ne', '<cmd>NERDTree<CR>', { remap = true })

View file

@ -16,6 +16,7 @@
- cmake
- clang
- npm
- lua-language-server
when:
ansible_facts['distribution'] == 'Archlinux'
@ -36,6 +37,7 @@
- cmake
- clang
- npm
- lua-language-server
when:
ansible_facts['distribution'] == 'Debian'