2023-07-17 17:18:14 +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-17 17:18:14 +00:00
|
|
|
end)
|
|
|
|
|
|
|
|
-- Language servers
|
2023-08-07 09:28:31 +00:00
|
|
|
if (MY_OS == 'Linux') then
|
2023-07-17 17:18:14 +00:00
|
|
|
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'
|
2023-07-17 17:18:14 +00:00
|
|
|
})
|
2023-08-07 09:28:31 +00:00
|
|
|
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',
|
|
|
|
})
|
2023-08-07 09:28:31 +00:00
|
|
|
end
|
2023-07-17 17:18:14 +00:00
|
|
|
|
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
|
|
|
|
2023-07-17 17:18:14 +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
|
|
|
|
2023-07-27 09:52:58 +00:00
|
|
|
require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls())
|
2023-07-21 08:46:34 +00:00
|
|
|
|
2023-07-26 08:46:02 +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)
|
2023-07-26 08:46:02 +00:00
|
|
|
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",
|
2023-07-26 08:46:02 +00:00
|
|
|
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
|
|
|
|
2023-07-17 17:18:14 +00:00
|
|
|
lsp.setup()
|