Add lua LSP

This commit is contained in:
Evie Litherland-Smith 2022-11-02 09:05:01 +00:00
parent bc9131554e
commit b7b1ab29c5
2 changed files with 26 additions and 3 deletions

View file

@ -125,6 +125,29 @@ require('lspconfig')['fortls'].setup{
capabilities = capabilities capabilities = capabilities
} }
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,
},
},
},
}
require'nvim-treesitter.configs'.setup { require'nvim-treesitter.configs'.setup {
highlight = { highlight = {
ensure_installed = {"python", "markdown", "lua", "yaml", "bash"}, ensure_installed = {"python", "markdown", "lua", "yaml", "bash"},

View file

@ -1,12 +1,12 @@
function map(mode, shortcut, command) local function map(mode, shortcut, command)
vim.api.nvim_set_keymap(mode, shortcut, command, { noremap = true, silent = true }) vim.api.nvim_set_keymap(mode, shortcut, command, { noremap = true, silent = true })
end end
function nmap(shortcut, command) local function nmap(shortcut, command)
map('n', shortcut, command) map('n', shortcut, command)
end end
function imap(shortcut, command) local function imap(shortcut, command)
map('i', shortcut, command) map('i', shortcut, command)
end end