nvim: add undotree
This commit is contained in:
parent
216df53a1e
commit
a09c0a1096
@ -17,6 +17,10 @@ return {
|
|||||||
-- animation = false, -- 禁用動畫效果
|
-- animation = false, -- 禁用動畫效果
|
||||||
sidebar_filetypes = {
|
sidebar_filetypes = {
|
||||||
['neo-tree'] = {event = 'BufWipeout'},
|
['neo-tree'] = {event = 'BufWipeout'},
|
||||||
|
undotree = {
|
||||||
|
text = 'undotree',
|
||||||
|
align = 'center', -- *optionally* specify an alignment (either 'left', 'center', or 'right')
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,30 +1,70 @@
|
|||||||
return {
|
return {
|
||||||
|
|
||||||
{
|
{
|
||||||
"jiaoshijie/undotree",
|
"mbbill/undotree",
|
||||||
dependencies = "nvim-lua/plenary.nvim",
|
config = function()
|
||||||
config = true,
|
-- vim.g.mundo_preview_bottom = 1
|
||||||
keys = { -- load the plugin only when using it's keybinding:
|
-- vim.g.mundo_auto_preview = 1
|
||||||
{ "<F6>", "<cmd>lua require('undotree').toggle()<cr>" },
|
-- vim.g.mundo_window_height = 20
|
||||||
{ "<leader>u", "<cmd>lua require('undotree').toggle()<cr>" },
|
-- vim.g.mundo_window_width = 80
|
||||||
},
|
-- vim.g.mundo_window_top = 0
|
||||||
opts = {
|
-- vim.g.mundo_window_left = 0
|
||||||
float_diff = true, -- using float window previews diff, set this `true` will disable layout option
|
|
||||||
layout = "left_bottom", -- "left_bottom", "left_left_bottom"
|
vim.keymap.set('n', '<F6>', vim.cmd.UndotreeToggle)
|
||||||
position = "right", -- "left", "right", "bottom"
|
vim.g.undotree_WindowLayout = 3
|
||||||
ignore_filetype = { 'undotree', 'undotreeDiff', 'qf', 'TelescopePrompt', 'spectre_panel', 'tsplayground' },
|
|
||||||
window = {
|
vim.cmd([[
|
||||||
winblend = 30,
|
function g:Undotree_CustomMap()
|
||||||
},
|
map <buffer> <s-DOWN> J
|
||||||
keymaps = {
|
map <buffer> <s-UP> K
|
||||||
['j'] = "move_next",
|
endfunction
|
||||||
['k'] = "move_prev",
|
]])
|
||||||
['gj'] = "move2parent",
|
-- 使用 vim.cmd 執行 Vim 傳統語法
|
||||||
['J'] = "move_change_next",
|
-- vim.cmd([[
|
||||||
['K'] = "move_change_prev",
|
-- nnoremap <F6> :UndotreeToggle<CR>
|
||||||
['<cr>'] = "action_enter",
|
-- if !exists('g:undotree_WindowLayout')
|
||||||
['p'] = "enter_diffbuf",
|
-- let g:undotree_WindowLayout = 1
|
||||||
['q'] = "quit",
|
-- endif
|
||||||
},
|
-- ]])
|
||||||
},
|
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
-- {
|
||||||
|
-- "mbbill/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>" },
|
||||||
|
-- },
|
||||||
|
-- }
|
||||||
|
|
||||||
|
-- {
|
||||||
|
-- "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",
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- }
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@ return {
|
|||||||
disabled_filetypes = {
|
disabled_filetypes = {
|
||||||
statusline = {},
|
statusline = {},
|
||||||
winbar = {},
|
winbar = {},
|
||||||
|
{'undotree'}
|
||||||
},
|
},
|
||||||
ignore_focus = {},
|
ignore_focus = {},
|
||||||
always_divide_middle = true,
|
always_divide_middle = true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user