nvim: undolist

This commit is contained in:
2025-05-01 11:40:50 +08:00
parent 7ad0d308e5
commit 216df53a1e
2 changed files with 31 additions and 1 deletions

View File

@@ -0,0 +1,30 @@
return {
{
"jiaoshijie/undotree",
dependencies = "nvim-lua/plenary.nvim",
config = true,
keys = { -- load the plugin only when using it's keybinding:
{ "<F6>", "<cmd>lua require('undotree').toggle()<cr>" },
{ "<leader>u", "<cmd>lua require('undotree').toggle()<cr>" },
},
opts = {
float_diff = true, -- using float window previews diff, set this `true` will disable layout option
layout = "left_bottom", -- "left_bottom", "left_left_bottom"
position = "right", -- "left", "right", "bottom"
ignore_filetype = { 'undotree', 'undotreeDiff', 'qf', 'TelescopePrompt', 'spectre_panel', 'tsplayground' },
window = {
winblend = 30,
},
keymaps = {
['j'] = "move_next",
['k'] = "move_prev",
['gj'] = "move2parent",
['J'] = "move_change_next",
['K'] = "move_change_prev",
['<cr>'] = "action_enter",
['p'] = "enter_diffbuf",
['q'] = "quit",
},
},
}
}