misc: update lsp config
parent
3b11323f80
commit
39a2d68c8c
|
@ -15,6 +15,9 @@ local M = {
|
||||||
return false
|
return false
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
lsp_servers = {
|
||||||
|
"goimports", "gofumpt", "basedpyright"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
---@type vim.lsp.Config
|
||||||
|
return {}
|
|
@ -0,0 +1,28 @@
|
||||||
|
return {
|
||||||
|
-- File types that should automatically attach this LSP server
|
||||||
|
filetypes = { "python" },
|
||||||
|
|
||||||
|
-- Root directory markers - LSP will search for these files/directories
|
||||||
|
-- to determine the project root. Nested arrays indicate equal priority.
|
||||||
|
-- The first match wins within each priority level.
|
||||||
|
root_markers = {
|
||||||
|
"pyproject.toml",
|
||||||
|
"setup.py",
|
||||||
|
"setup.cfg",
|
||||||
|
"requirements.txt",
|
||||||
|
"pyrightconfig.json",
|
||||||
|
".git",
|
||||||
|
".hg",
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Server-specific settings (varies by language server)
|
||||||
|
-- Check your language server's documentation for available options
|
||||||
|
settings = {
|
||||||
|
python = {
|
||||||
|
analysis = {
|
||||||
|
autoSearchPaths = true,
|
||||||
|
useLibraryCodeForTypes = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
---@type vim.lsp.Config
|
||||||
|
return {
|
||||||
|
keys = {
|
||||||
|
{ "<leader>ch", "<cmd>ClangdSwitchSourceHeader<cr>", desc = "Switch Source/Header (C/C++)" },
|
||||||
|
},
|
||||||
|
root_dir = function(name)
|
||||||
|
return require("lspconfig.util").root_pattern(
|
||||||
|
"Makefile",
|
||||||
|
"configure.ac",
|
||||||
|
"configure.in",
|
||||||
|
"config.h.in",
|
||||||
|
"meson.build",
|
||||||
|
"meson_options.txt",
|
||||||
|
"build.ninja"
|
||||||
|
)(fname) or require("lspconfig.util").root_pattern("compile_commands.json", "compile_flags.txt")(fname) or require(
|
||||||
|
"lspconfig.util"
|
||||||
|
).find_git_ancestor(name)
|
||||||
|
end,
|
||||||
|
cmd = {
|
||||||
|
"clangd",
|
||||||
|
"--background-index",
|
||||||
|
"--clang-tidy",
|
||||||
|
"--header-insertion=iwyu",
|
||||||
|
"--completion-arg-placeholders",
|
||||||
|
"--function-arg-placeholders",
|
||||||
|
"--fallback-style=llvm",
|
||||||
|
},
|
||||||
|
init_options = {
|
||||||
|
usePlaceholders = true,
|
||||||
|
completeUnimported = true,
|
||||||
|
clangdFileStatus = true,
|
||||||
|
},
|
||||||
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
---@type vim.lsp.Config
|
---@type vim.lsp.Config
|
||||||
return {
|
return {
|
||||||
cmd = { "gopls" },
|
|
||||||
filetypes = { "go", "gomod", "gosum" },
|
filetypes = { "go", "gomod", "gosum" },
|
||||||
root_markers = {
|
root_markers = {
|
||||||
"go.mod",
|
"go.mod",
|
||||||
|
@ -8,8 +7,21 @@ return {
|
||||||
},
|
},
|
||||||
settings = {
|
settings = {
|
||||||
gopls = {
|
gopls = {
|
||||||
|
gofumpt = true,
|
||||||
|
codelenses = {
|
||||||
|
gc_details = false,
|
||||||
|
generate = true,
|
||||||
|
regenerate_cgo = true,
|
||||||
|
run_govulncheck = true,
|
||||||
|
test = true,
|
||||||
|
tidy = true,
|
||||||
|
upgrade_dependency = true,
|
||||||
|
vendor = true,
|
||||||
|
},
|
||||||
analyses = {
|
analyses = {
|
||||||
|
nliness = true,
|
||||||
unusedparams = true,
|
unusedparams = true,
|
||||||
|
unusedwrite = true,
|
||||||
},
|
},
|
||||||
hints = {
|
hints = {
|
||||||
assignVariableTypes = true,
|
assignVariableTypes = true,
|
||||||
|
@ -20,8 +32,10 @@ return {
|
||||||
parameterNames = true,
|
parameterNames = true,
|
||||||
rangeVariableTypes = true,
|
rangeVariableTypes = true,
|
||||||
},
|
},
|
||||||
|
usePlaceholders = true,
|
||||||
|
completeUnimported = true,
|
||||||
staticcheck = true,
|
staticcheck = true,
|
||||||
gofumpt = true,
|
directoryFilters = { "-.git", "-.vscode", "-.idea", "-.vscode-test", "-node_modules" },
|
||||||
semanticTokens = true,
|
semanticTokens = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
return {
|
||||||
|
capabilities = {
|
||||||
|
textDocument = {
|
||||||
|
foldingRange = {
|
||||||
|
dynamicRegistration = false,
|
||||||
|
lineFoldingOnly = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
settings = {
|
||||||
|
redhat = { telemetry = { enabled = false } },
|
||||||
|
yaml = {
|
||||||
|
keyOrdering = false,
|
||||||
|
format = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
validate = true,
|
||||||
|
schemaStore = {
|
||||||
|
enable = false,
|
||||||
|
url = "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
|
@ -18,6 +18,9 @@ return {
|
||||||
words = { enabled = false },
|
words = { enabled = false },
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
|
{ "<leader>,", function() Snacks.picker.buffers() end, desc = "Buffers" },
|
||||||
|
{ "<leader>:", function() Snacks.picker.command_history() end, desc = "Command History" },
|
||||||
|
{ "<leader>n", function() Snacks.picker.notifications() end, desc = "Notification History" },
|
||||||
{ "<leader>e", function() Snacks.explorer() end, desc = "Snack File Explorer" },
|
{ "<leader>e", function() Snacks.explorer() end, desc = "Snack File Explorer" },
|
||||||
{ "<leader><space>", function() Snacks.picker.smart() end, desc = "Smart Find Files" },
|
{ "<leader><space>", function() Snacks.picker.smart() end, desc = "Smart Find Files" },
|
||||||
{ "<leader>fg", function() Snacks.picker.git_files() end, desc = "Find Git Files" },
|
{ "<leader>fg", function() Snacks.picker.git_files() end, desc = "Find Git Files" },
|
||||||
|
|
Loading…
Reference in New Issue