nvim/after/plugin/lsp.lua

135 lines
2.9 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)
lsp.default_keymaps({buffer = bufnr})
end)
-- Language servers
lsp.ensure_installed({
-- Replace these with whatever servers you want to install
'bashls',
2023-07-27 09:26:28 +00:00
<<<<<<< HEAD
2023-07-22 12:00:46 +00:00
--'clangd',
2023-07-21 20:19:38 +00:00
'julials',
2023-07-22 12:00:46 +00:00
--'lua_ls',
2023-07-21 20:19:38 +00:00
'ltex',
'pylsp',
2023-07-22 12:00:46 +00:00
--'texlab',
--'zls'
2023-07-27 09:26:28 +00:00
=======
2023-07-21 11:57:50 +00:00
'clangd',
'julials',
'lua_ls',
2023-07-21 07:58:44 +00:00
'ltex',
'pylsp',
'texlab',
'zls'
2023-07-27 09:26:28 +00:00
>>>>>>> Linux
2023-07-21 20:19:38 +00:00
})
--[[
START LANGUAGE SERVERS CONFIG HERE!!!
]]--
-- (Optional) Configure lua language server for neovim
2023-07-27 09:26:28 +00:00
<<<<<<< HEAD
2023-07-21 20:19:38 +00:00
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,
--})
require('lspconfig').julials.setup({})
2023-07-27 09:26:28 +00:00
=======
require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls())
2023-07-21 08:46:34 +00:00
require('lspconfig').texlab.setup({})
2023-07-27 09:26:28 +00:00
>>>>>>> Linux
2023-07-21 20:19:38 +00:00
require('lspconfig').ltex.setup({
settings = {
ltex = {
language = "en-GB",
},
},
})
2023-07-27 09:26:28 +00:00
<<<<<<< HEAD
2023-07-22 12:00:46 +00:00
require('lspconfig').lua_ls.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,
},
},
}
2023-07-21 20:19:38 +00:00
})
2023-07-22 12:00:46 +00:00
require('lspconfig').pylsp.setup({})
2023-07-27 09:26:28 +00:00
=======
2023-07-21 08:46:34 +00:00
require('lspconfig').pylsp.setup({})
--require('lspconfig').gopls.setup({
-- on_attach = on_attach,
--})
require('lspconfig').julials.setup({
--on_attach = on_attach,
symbol_cache_download = true,
--symbol_server = "https://symbol-server",
on_new_config = function(new_config, _)
local julia = vim.fn.expand("/usr/share/julia/bin/julia")
if require'lspconfig'.util.path.is_file(julia) then
vim.notify("Hello!")
new_config.cmd[1] = julia
end
end
})
require('lspconfig').zls.setup({})
require('lspconfig').bashls.setup({})
2023-07-27 09:26:28 +00:00
>>>>>>> Linux
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-27 09:26:28 +00:00
<<<<<<< HEAD
2023-07-22 12:00:46 +00:00
require('lspconfig').texlab.setup({})
require('lspconfig').zls.setup({})
2023-07-27 09:26:28 +00:00
=======
>>>>>>> Linux
2023-07-21 20:19:38 +00:00
--[[
END LANGUAGE SERVERS CONFIG HERE!!!
]]--
lsp.setup()