添加undotree插件

This commit is contained in:
caprain 2026-04-18 09:12:18 +08:00
parent ea787c96f7
commit d033379cb2
3 changed files with 31 additions and 0 deletions

View file

@ -0,0 +1,25 @@
-- === undotree ===
local P = {
name = "undotree",
}
-- 快捷键触发
vim.keymap.set({ "n", "x" }, "<leader>u", function()
PackUtils.load(P, function()
require('undotree').setup({
keymaps = {
["e"] = "move_next",
["u"] = "move_prev",
["n"] = "move2parent",
["E"] = "move_change_next",
["U"] = "move_change_prev",
["<cr>"] = "action_enter",
["i"] = "action_enter",
["d"] = "enter_diffbuf",
["q"] = "quit",
["S"] = "update_undotree_view",
},
})
end)
require('undotree').toggle()
end, { desc = "toggle undotree" })

View file

@ -27,6 +27,8 @@ local specs = {
-- ufo.lua 折叠插件
'https://github.com/kevinhwang91/nvim-ufo',
'https://github.com/kevinhwang91/promise-async',
-- undotree.lua
'https://github.com/jiaoshijie/undotree',
-- stickscroll.lua 代码函数名称浏览时固定
'https://github.com/nvim-treesitter/nvim-treesitter-context',
-- bufferline.lua 顶部状态栏