Updated config
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
require("settings")
|
||||
require("lsp")
|
||||
require("packages")
|
||||
require("keys")
|
||||
require("autocmds")
|
||||
|
5
.config/nvim/lsp/clangd.lua
Normal file
5
.config/nvim/lsp/clangd.lua
Normal file
@ -0,0 +1,5 @@
|
||||
return {
|
||||
cmd = { "clangd", "--background-index" },
|
||||
root_markers = { "meson_options.txt", "CMakePresets.json" },
|
||||
filetypes = { "c", "cpp" },
|
||||
}
|
5
.config/nvim/lsp/gopls.lua
Normal file
5
.config/nvim/lsp/gopls.lua
Normal file
@ -0,0 +1,5 @@
|
||||
return {
|
||||
cmd = { "gopls" },
|
||||
root_markers = { "go.mod", "go.work" },
|
||||
filetypes = { "go", "gomod", "gowork", "gotmpl" },
|
||||
}
|
5
.config/nvim/lsp/rust-analyzer.lua
Normal file
5
.config/nvim/lsp/rust-analyzer.lua
Normal file
@ -0,0 +1,5 @@
|
||||
return {
|
||||
cmd = { "rust-analyzer" },
|
||||
root_markers = { "Cargo.toml" },
|
||||
filetypes = { "rust" },
|
||||
}
|
@ -11,6 +11,17 @@ on({ "BufNewFile", "BufRead" }, {
|
||||
end,
|
||||
})
|
||||
|
||||
on({ "LspAttach" }, {
|
||||
desc = "LSP completion",
|
||||
group = group,
|
||||
callback = function(ev)
|
||||
local client = vim.lsp.get_client_by_id(ev.data.client_id)
|
||||
if client:supports_method("textDocument/completion") then
|
||||
vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true })
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
on({ "TermOpen", "TermEnter" }, {
|
||||
desc = "Disable sign column in terminals",
|
||||
group = group,
|
||||
|
10
.config/nvim/lua/disabled/snacks.lua
Normal file
10
.config/nvim/lua/disabled/snacks.lua
Normal file
@ -0,0 +1,10 @@
|
||||
return {
|
||||
"folke/snacks.nvim",
|
||||
event = "BufReadPre",
|
||||
opts = {
|
||||
explorer = {
|
||||
replace_netrw = true,
|
||||
},
|
||||
},
|
||||
config = true,
|
||||
}
|
9
.config/nvim/lua/lsp.lua
Normal file
9
.config/nvim/lua/lsp.lua
Normal file
@ -0,0 +1,9 @@
|
||||
vim.diagnostic.config({
|
||||
virtual_lines = true,
|
||||
})
|
||||
|
||||
vim.lsp.enable({
|
||||
"clangd",
|
||||
"gopls",
|
||||
"rust-analyzer",
|
||||
})
|
@ -51,4 +51,8 @@ opt.statusline = "%{repeat('─',winwidth('.'))}"
|
||||
|
||||
-- Undo
|
||||
opt.undofile = true
|
||||
opt.undolevels = 10000
|
||||
opt.undolevels = 10000
|
||||
|
||||
-- Virtual text
|
||||
vim.diagnostic.config({ virtual_lines = true })
|
||||
vim.lsp.enable({"clangd", "gopls", "rust-analyzer"})
|
Reference in New Issue
Block a user