nvim/after/plugin/lsp.lua

82 lines
1.6 KiB
Lua
Raw Normal View History

2023-07-21 20:19:38 +00:00
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 })
2023-07-21 20:19:38 +00:00
end)
-- Language servers
lsp.ensure_installed({
2023-08-04 08:09:55 +00:00
-- Replace these with whatever servers you want to install
'bashls',
--'clangd',
'julials',
--'lua_ls',
--'ltex',
'pylsp',
--'texlab',
--'zls'
2023-07-21 20:19:38 +00:00
})
--[[
START LANGUAGE SERVERS CONFIG HERE!!!
2023-08-04 08:09:55 +00:00
]]
--
2023-07-21 20:19:38 +00:00
-- (Optional) Configure lua language server for neovim
2023-07-22 12:00:46 +00:00
require('lspconfig').bashls.setup({})
2023-07-21 20:19:38 +00:00
2023-07-22 12:00:46 +00:00
require('lspconfig').clangd.setup({})
--require('lspconfig').gopls.setup({
-- on_attach = on_attach,
--})
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
require('lspconfig').texlab.setup({})
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
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 20:19:38 +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 20:19:38 +00:00
--[[
END LANGUAGE SERVERS CONFIG HERE!!!
2023-08-04 08:09:55 +00:00
]]
--
2023-07-21 20:19:38 +00:00
lsp.setup()