nvim/after/plugin/lsp.lua

86 lines
1.7 KiB
Lua
Raw Normal View History

local lsp = require('lsp-zero').preset({})
lsp.on_attach(function(client, bufnr)
2023-08-04 08:09:55 +00:00
lsp.default_keymaps({ buffer = bufnr })
end)
-- Language servers
if (MY_OS == 'Linux') then
lsp.ensure_installed({
2023-08-04 08:09:55 +00:00
-- Replace these with whatever servers you want to install
'bashls',
2023-08-07 09:43:48 +00:00
'clangd',
2023-08-04 08:09:55 +00:00
'julials',
2023-08-07 09:43:48 +00:00
'lua_ls',
'ltex',
2023-08-04 08:09:55 +00:00
'pylsp',
2023-08-07 09:43:48 +00:00
'texlab',
'zls'
})
elseif (MY_OS == 'FreeBSD') then
2023-08-07 09:43:48 +00:00
lsp.ensure_installed({
-- Replace these with whatever servers you want to install
'bashls',
'julials',
'pylsp',
})
end
2023-07-21 08:46:34 +00:00
--[[
START LANGUAGE SERVERS CONFIG HERE!!!
2023-08-04 08:09:55 +00:00
]]
--
2023-07-21 08:46:34 +00:00
-- (Optional) Configure lua language server for neovim
2023-07-22 12:00:46 +00:00
require('lspconfig').bashls.setup({})
2023-07-21 08:46:34 +00:00
2023-07-22 12:00:46 +00:00
require('lspconfig').clangd.setup({})
2023-08-04 09:40:30 +00:00
--require('lspconfig').gopls.setup({})
2023-07-22 12:00:46 +00:00
2023-07-27 12:06:46 +00:00
require('lspconfig').julials.setup({})
2023-07-21 08:46:34 +00:00
require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls())
2023-07-21 08:46:34 +00:00
local path = vim.fn.stdpath("config") .. "/after/plugin/dictionary-gb.txt"
local words = {}
for word in io.open(path, "r"):lines() do
2023-08-04 08:09:55 +00:00
table.insert(words, word)
end
2023-07-21 08:46:34 +00:00
require('lspconfig').ltex.setup({
2023-08-04 08:09:55 +00:00
settings = {
ltex = {
language = "en-GB",
dictionary = {
["en-GB"] = words,
},
2023-08-04 08:09:55 +00:00
},
},
2023-07-21 08:46:34 +00:00
})
-- source: https://rust-analyzer.github.io/manual.html#nvim-lsp
--require('lspconfig').rust_analyzer.setup({
-- on_attach = on_attach,
-- settings = {
-- ["rust-analyzer"] = {
-- inlayHints = {
-- closingBraceHints = true, -- Whether to show inlay hints after a closing } to indicate what item it belongs to.
-- }
-- }
-- }
--})
2023-07-22 12:00:46 +00:00
require('lspconfig').texlab.setup({})
require('lspconfig').zls.setup({})
2023-07-21 08:46:34 +00:00
--[[
END LANGUAGE SERVERS CONFIG HERE!!!
2023-08-04 08:09:55 +00:00
]]
--
2023-07-21 08:46:34 +00:00
lsp.setup()