aboutsummaryrefslogtreecommitdiff
path: root/config/nvim/lua/plugins.lua
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2022-09-19 19:55:10 +0200
committerCharles Cabergs <me@cacharle.xyz>2022-09-19 19:55:10 +0200
commit87c3d970ef18dc13bd504ba7e48ec78dfd82737f (patch)
treeca0dd66140751d8f806cf48a8501736d8cd09f72 /config/nvim/lua/plugins.lua
parent07db70fcebadc3df627a0b9adeed417eaf8cf16f (diff)
downloaddotfiles-87c3d970ef18dc13bd504ba7e48ec78dfd82737f.tar.gz
dotfiles-87c3d970ef18dc13bd504ba7e48ec78dfd82737f.tar.bz2
dotfiles-87c3d970ef18dc13bd504ba7e48ec78dfd82737f.zip
Added clangd language server
Diffstat (limited to 'config/nvim/lua/plugins.lua')
-rw-r--r--config/nvim/lua/plugins.lua63
1 files changed, 33 insertions, 30 deletions
diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua
index 3e783e4..eb00dc3 100644
--- a/config/nvim/lua/plugins.lua
+++ b/config/nvim/lua/plugins.lua
@@ -56,6 +56,11 @@ return require("packer").startup(function()
"neovim/nvim-lspconfig",
ft = {"rust", "python", "c", "cpp", "lua", "go", "haskell", "ocaml"},
config = function()
+ vim.diagnostic.config {
+ signs = false,
+ update_in_insert = false,
+ }
+
local on_attach = function(_, bufnr)
local opts = { noremap = true, silent = true }
local map = function(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
@@ -88,7 +93,7 @@ return require("packer").startup(function()
}
}
-- from: https://github.com/golang/tools/blob/master/gopls/doc/vim.md#neovim-imports
- function go_import_callback()
+ local go_import_callback = function()
local wait_ms = 1000
local params = vim.lsp.util.make_range_params()
params.context = {only = {"source.organizeImports"}}
@@ -128,40 +133,38 @@ return require("packer").startup(function()
}
-- brew install haskell-language-server
- lspconfig.hls.setup {}
+ lspconfig.hls.setup { on_attach = on_attach }
-- opam install ocaml-lsp-server
- lspconfig.ocamllsp.setup {}
+ lspconfig.ocamllsp.setup { on_attach = on_attach }
-- package lua-language-server on ArchLinux
- -- lspconfig.sumneko_lua.setup {
- -- on_attach = on_attach ,
- -- 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 = vim.split(package.path, ";"),
- -- },
- -- diagnostics = {
- -- -- Get the language server to recognize the `vim` global
- -- globals = {"vim"},
- -- },
- -- workspace = {
- -- -- Make the server aware of Neovim runtime files
- -- library = {
- -- [vim.fn.expand("$VIMRUNTIME/lua")] = true,
- -- [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true,
- -- },
- -- },
- -- }
- -- },
- -- }
- vim.diagnostic.config {
- signs = false,
- update_in_insert = false,
+ lspconfig.sumneko_lua.setup {
+ on_attach = on_attach ,
+ 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 = vim.split(package.path, ";"),
+ },
+ diagnostics = {
+ -- Get the language server to recognize the `vim` global
+ globals = {"vim"},
+ },
+ workspace = {
+ -- Make the server aware of Neovim runtime files
+ library = {
+ [vim.fn.expand("$VIMRUNTIME/lua")] = true,
+ [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true,
+ },
+ },
+ }
+ },
}
+
+ lspconfig.clangd.setup { on_attach = on_attach }
end,
}