添加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 顶部状态栏

View file

@ -116,6 +116,10 @@
"rev": "c0603ca8f31299c83deaa9a24a63d67116db25cd",
"src": "https://github.com/alexpasmantier/tv.nvim"
},
"undotree": {
"rev": "0e6d41d55ad147407e4ba00a292973de8db0b836",
"src": "https://github.com/jiaoshijie/undotree"
},
"vim-suda": {
"rev": "c492741b4679b3cdd4d9e34138209784e061d916",
"src": "https://github.com/lambdalisue/vim-suda"