-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update .chezmoiignore Update .config/nvim/lua/plugins/none-ls.lua Update .config/nvim/lua/plugins/nvim-lspconfig.lua
- Loading branch information
1 parent
4183427
commit 7ddde21
Showing
4 changed files
with
72 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
command = "nvim" | ||
|
||
[git] | ||
## autoCommit = true | ||
## autoPush = true | ||
autoCommit = true | ||
autoPush = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
README.md | ||
|
||
tmux/plugins/ | ||
nix/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,79 @@ | ||
return { | ||
"neovim/nvim-lspconfig", | ||
event = { "BufReadPre", "BufNewFile" }, | ||
dependencies = { | ||
"williamboman/mason.nvim", | ||
"williamboman/mason-lspconfig.nvim", | ||
}, | ||
config = function() | ||
local lspconfig = require("lspconfig") | ||
"neovim/nvim-lspconfig", | ||
event = { "BufReadPre", "BufNewFile" }, | ||
dependencies = { | ||
"williamboman/mason.nvim", | ||
"williamboman/mason-lspconfig.nvim", | ||
}, | ||
config = function() | ||
local lspconfig = require("lspconfig") | ||
|
||
if lspconfig.lua_ls then | ||
lspconfig.lua_ls.setup({ | ||
settings = { | ||
Lua = { | ||
diagnostics = { | ||
globals = { | ||
"vim", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}) | ||
end | ||
if lspconfig.lua_ls then | ||
lspconfig.lua_ls.setup({ | ||
settings = { | ||
Lua = { | ||
diagnostics = { | ||
globals = { | ||
"vim", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}) | ||
end | ||
|
||
if lspconfig.ts_ls then | ||
lspconfig.ts_ls.setup({}) | ||
end | ||
if lspconfig.ts_ls then | ||
lspconfig.ts_ls.setup({}) | ||
end | ||
|
||
if lspconfig.ocamllsp then | ||
lspconfig.ocamllsp.setup({}) | ||
end | ||
if lspconfig.ocamllsp then | ||
lspconfig.ocamllsp.setup({}) | ||
end | ||
|
||
if lspconfig.gopls then | ||
lspconfig.gopls.setup({}) | ||
end | ||
if lspconfig.gopls then | ||
lspconfig.gopls.setup({}) | ||
end | ||
|
||
if lspconfig.terraformls then | ||
lspconfig.terraformls.setup({ | ||
on_attach = function(client, _) | ||
client.server_capabilities.semanticTokensProvider = nil | ||
end, | ||
}) | ||
end | ||
if lspconfig.terraformls then | ||
lspconfig.terraformls.setup({ | ||
on_attach = function(client, _) | ||
client.server_capabilities.semanticTokensProvider = nil | ||
end, | ||
}) | ||
end | ||
|
||
if lspconfig.typos_lsp then | ||
lspconfig.typos_lsp.setup({ | ||
init_options = { | ||
config = "~/.config/typos/.typos.toml", | ||
}, | ||
}) | ||
end | ||
if lspconfig.typos_lsp then | ||
lspconfig.typos_lsp.setup({ | ||
init_options = { | ||
config = "~/.config/typos/.typos.toml", | ||
}, | ||
}) | ||
end | ||
|
||
-- Lsp Keymaps. | ||
-- global. | ||
-- vim.keymap.set("n", "<space>e", vim.diagnostic.open_float) | ||
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev) | ||
vim.keymap.set("n", "]d", vim.diagnostic.goto_next) | ||
vim.keymap.set("n", "<space>q", vim.diagnostic.setloclist) | ||
if lspconfig.nil_ls then | ||
lspconfig.nil_ls.setup({}) | ||
end | ||
|
||
-- after the language server attaches to the current buffer | ||
vim.api.nvim_create_autocmd("LspAttach", { | ||
group = vim.api.nvim_create_augroup("UserLspConfig", {}), | ||
callback = function(ev) | ||
vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc" | ||
-- Lsp Keymaps. | ||
-- global. | ||
-- vim.keymap.set("n", "<space>e", vim.diagnostic.open_float) | ||
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev) | ||
vim.keymap.set("n", "]d", vim.diagnostic.goto_next) | ||
vim.keymap.set("n", "<space>q", vim.diagnostic.setloclist) | ||
|
||
local opts = { buffer = ev.buf } | ||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts) | ||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) | ||
vim.keymap.set("n", "<space>k", vim.lsp.buf.hover, opts) | ||
vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, opts) | ||
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts) | ||
end, | ||
}) | ||
end, | ||
-- after the language server attaches to the current buffer | ||
vim.api.nvim_create_autocmd("LspAttach", { | ||
group = vim.api.nvim_create_augroup("UserLspConfig", {}), | ||
callback = function(ev) | ||
vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc" | ||
|
||
local opts = { buffer = ev.buf } | ||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts) | ||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) | ||
vim.keymap.set("n", "<space>k", vim.lsp.buf.hover, opts) | ||
vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, opts) | ||
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts) | ||
end, | ||
}) | ||
end, | ||
} |