add lua language server using overlays

This commit is contained in:
Salar Rahmanian 2021-07-11 22:50:49 -07:00
parent 49c5fb4a8d
commit 69c7fdda24
3 changed files with 80 additions and 0 deletions

View file

@ -33,6 +33,7 @@ _G.load_config = function()
require('nvim-autopairs').setup()
require("which-key").setup()
require('gitsigns').setup()
require("salargalaxyline")
-- Treesitter
@ -208,6 +209,42 @@ _G.load_config = function()
nvim_lsp[lsp].setup { on_attach = on_attach }
end
-- lua language server
local sumneko_binary = vim.fn.getenv("HOME").."/.nix-profile/bin/lua-language-server"
local runtime_path = vim.split(package.path, ';')
table.insert(runtime_path, 'lua/?.lua')
table.insert(runtime_path, 'lua/?/init.lua')
require('lspconfig').sumneko_lua.setup {
cmd = { sumneko_binary },
on_attach = on_attach,
capabilities = capabilities,
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 = runtime_path,
},
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,
},
},
},
}
-- metals
vim.opt_global.shortmess:remove("F"):append("c")
metals_config = require("metals").bare_config