mirror of
https://github.com/cap153/nvim.git
synced 2026-04-17 17:55:31 +08:00
first commit
This commit is contained in:
commit
3b19a9c8a8
29 changed files with 2428 additions and 0 deletions
37
lua/pack/configs/snacks.lua
Normal file
37
lua/pack/configs/snacks.lua
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
-- === Snacks ===
|
||||
if vim.g.vscode then return end
|
||||
|
||||
local P = {
|
||||
name = "snacks.nvim",
|
||||
module = "snacks",
|
||||
}
|
||||
|
||||
PackUtils.load(P, function(plugin)
|
||||
plugin.setup({
|
||||
image = {},
|
||||
lazygit = {},
|
||||
notifier = {}, -- 替代了folke/noice.nvim插件的rcarriga/nvim-notify依赖
|
||||
picker = {
|
||||
win = {
|
||||
input = {
|
||||
keys = { -- Esc直接关闭窗口,不进入normal模式
|
||||
["<Esc>"] = { "close", mode = { "n", "i" } },
|
||||
["<c-e>"] = { "list_down", mode = { "i", "n" } },
|
||||
["<c-u>"] = { "list_up", mode = { "i", "n" } },
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
end)
|
||||
|
||||
local map = require("core.keymap")
|
||||
map:lua("<c-g>", "Snacks.lazygit()")
|
||||
map:lua("gr", "Snacks.picker.lsp_references()")
|
||||
|
||||
-- 彻底清除 Neovim 0.10+ 自带的 LSP 默认映射,解除 `gr` 的 1秒等待延迟
|
||||
local default_lsp_keys = { "grr", "grn", "gra", "gri", "grt", "grx" }
|
||||
for _, key in ipairs(default_lsp_keys) do
|
||||
pcall(vim.keymap.del, "n", key) -- 使用 pcall 忽略找不到映射时的报错
|
||||
pcall(vim.keymap.del, "x", key)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue