This commit is contained in:
Fabian Becker
2023-12-10 16:17:14 +01:00
parent 6085f0ffb8
commit 3d575cd47a
23 changed files with 364 additions and 173 deletions

View File

@@ -1,3 +1,7 @@
if vim.g.vscode then
return
end
local Remap = require("halfdan.keymap")
local nnoremap = Remap.nnoremap
local inoremap = Remap.inoremap
@@ -120,45 +124,76 @@ local function config(_config)
return _config
end
local elixir = require('elixir')
elixir.setup(config({
-- repo = "mhanberg/elixir-ls", -- defaults to elixir-lsp/elixir-ls
-- branch = "mh/all-workspace-symbols", -- defaults to nil, just checkouts out the default branch, mutually exclusive with the `tag` option
cmd = {"/usr/local/opt/elixir-ls/rel/language_server.sh"},
settings = elixir.settings({
dialyzerEnabled = true,
fetchDeps = false,
enableTestLenses = true,
suggestSpecs = false,
}),
on_attach = function(client, bufnr)
on_attach(client, bufnr)
local map_opts = { buffer = true, noremap = true}
-- remove the pipe operator
vim.keymap.set("n", "<leader>fp", ":ElixirFromPipe<cr>", map_opts)
-- add the pipe operator
vim.keymap.set("n", "<leader>tp", ":ElixirToPipe<cr>", map_opts)
vim.keymap.set("v", "<leader>em", ":ElixirExpandMacro<cr>", map_opts)
end
}))
local elixir = require("elixir")
local elixirls = require("elixir.elixirls")
elixir.setup {
credo = {},
elixirls = {
enabled = true,
settings = elixirls.settings {
dialyzerEnabled = false,
enableTestLenses = false,
},
on_attach = function(client, bufnr)
vim.keymap.set("n", "<space>fp", ":ElixirFromPipe<cr>", { buffer = true, noremap = true })
vim.keymap.set("n", "<space>tp", ":ElixirToPipe<cr>", { buffer = true, noremap = true })
vim.keymap.set("v", "<space>em", ":ElixirExpandMacro<cr>", { buffer = true, noremap = true })
end,
}
}
-- local elixir = require('elixir')
-- elixir.setup(config({
-- -- repo = "mhanberg/elixir-ls", -- defaults to elixir-lsp/elixir-ls
-- -- branch = "mh/all-workspace-symbols", -- defaults to nil, just checkouts out the default branch, mutually exclusive with the `tag` option
-- cmd = {"/opt/elixir-ls/rel/language_server.sh"},
-- settings = elixir.settings({
-- dialyzerEnabled = true,
-- fetchDeps = false,
-- enableTestLenses = true,
-- suggestSpecs = false,
-- }),
-- on_attach = function(client, bufnr)
-- on_attach(client, bufnr)
--
-- local map_opts = { buffer = true, noremap = true}
--
-- -- remove the pipe operator
-- vim.keymap.set("n", "<leader>fp", ":ElixirFromPipe<cr>", map_opts)
-- -- add the pipe operator
-- vim.keymap.set("n", "<leader>tp", ":ElixirToPipe<cr>", map_opts)
-- vim.keymap.set("v", "<leader>em", ":ElixirExpandMacro<cr>", map_opts)
-- end
-- }))
--
-- Enable the following language servers
local servers = { 'gopls', 'julials', 'rust_analyzer', 'pyright' }
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup(config())
end
lspconfig.sumneko_lua.setup(config({
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 = {
globals = { 'vim' }
}
}
}
}))
-- 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,
},
},
},
}
require('rust-tools').setup({
tools = {