mirror of
https://github.com/cap153/nvim.git
synced 2026-04-19 11:31:21 +08:00
添加undotree插件
This commit is contained in:
parent
ea787c96f7
commit
d033379cb2
3 changed files with 31 additions and 0 deletions
25
lua/pack/configs/undotree.lua
Normal file
25
lua/pack/configs/undotree.lua
Normal 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" })
|
||||
|
|
@ -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 顶部状态栏
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue