chore(nvim): a lot

format, fix nvim-tree startup, update telescope, drop unused plugins
This commit is contained in:
2025-06-14 19:46:59 +08:00
parent 6a1889722c
commit 53e15c2324
35 changed files with 231 additions and 368 deletions

View File

@@ -1,4 +1,3 @@
M = {}
return M

View File

@@ -20,24 +20,24 @@ local extra_config = {
vim.api.nvim_get_runtime_file("", true),
"${3rd}/luv/library",
"${3rd}/luassert/library",
}
},
},
diagnostics = {
globals = {
"vim"
}
"vim",
},
},
completion = {
callSnippet = "Replace"
}
}
callSnippet = "Replace",
},
},
},
},
rust_analyzer = {
settings = {
rust_analyzer = {
check = {
command = "clippy"
command = "clippy",
},
diagnostics = {
experimental = true,
@@ -45,7 +45,7 @@ local extra_config = {
formatting = {
command = { "rustfmt" },
},
}
},
},
},
nixd = {
@@ -56,12 +56,12 @@ local extra_config = {
},
options = {
nixos = {
expr = '(builtins.getFlake ("git+file://" + toString ./.)).nixosConfigurations.imxyy-nix.options',
expr = '(builtins.getFlake ("git+file://" + toString ./.)).nixosConfigurations.imxyy-nix.options',
},
},
}
}
}
},
},
},
}
local capabilities = require("cmp_nvim_lsp").default_capabilities()
@@ -74,7 +74,7 @@ local lspconfig = require("lspconfig")
for _, server in ipairs(servers) do
local extra = extra_config[server] or {}
local config = {
capabilities = capabilities
capabilities = capabilities,
}
for k, v in pairs(extra) do
config[k] = v

View File

@@ -1,7 +1,6 @@
M = {
-- ensure_installed = require("plugins.lsp.servers")
ensure_installed = {}
ensure_installed = {},
}
return M

View File

@@ -3,10 +3,9 @@ M = {
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = ""
}
}
package_uninstalled = "",
},
},
}
return M

View File

@@ -4,13 +4,13 @@ local opt = require("core.globals").keymap_opt
vim.keymap.set("n", "K", vim.lsp.buf.hover, opt)
vim.keymap.set("n", "<leader>lR", vim.lsp.buf.rename, opt)
local icons = { }
local icons = {}
local sev = vim.diagnostic.severity
local signs = {
[sev.ERROR] = "",
[sev.WARN] = "",
[sev.HINT] = "",
[sev.INFO] = ""
[sev.INFO] = "",
}
for type, icon in pairs(icons) do
local hl = vim.diagnostic.severity[type]
@@ -18,7 +18,7 @@ for type, icon in pairs(icons) do
end
vim.diagnostic.config({
signs = {
text = signs
text = signs,
},
underline = true,
update_in_insert = true,
@@ -26,7 +26,7 @@ vim.diagnostic.config({
})
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
border = "single",
border = "single",
})
local diag_config1 = {
@@ -35,7 +35,7 @@ local diag_config1 = {
max = vim.diagnostic.severity.WARN,
},
spacing = 4,
prefix = ""
prefix = "",
},
virtual_lines = {
severity = {

View File

@@ -1,7 +1,7 @@
M = {
symbols = {
icon_source = "lspkind"
}
icon_source = "lspkind",
},
}
vim.keymap.set("n", "<leader>o", "<cmd>Outline<CR>", { desc = "Toggle Outline" })

View File

@@ -12,4 +12,3 @@ M = {
}
return M

View File

@@ -1,16 +1,19 @@
M = {
bind = true, -- This is mandatory, otherwise border config won't get registered.
handler_opts = {
border = "rounded"
border = "rounded",
},
hint_prefix = "^ ",
toggle_key = "<C-k>",
}
vim.keymap.set({ 'n' }, '<leader>k', require('lsp_signature').toggle_float_win,
{ silent = true, noremap = true, desc = 'toggle signature' })
vim.keymap.set(
{ "n" },
"<leader>k",
require("lsp_signature").toggle_float_win,
{ silent = true, noremap = true, desc = "toggle signature" }
)
vim.keymap.set({ 'n' }, 'K', vim.lsp.buf.signature_help,
{ silent = true, noremap = true, desc = 'toggle signature' })
vim.keymap.set({ "n" }, "K", vim.lsp.buf.signature_help, { silent = true, noremap = true, desc = "toggle signature" })
return M