diff --git a/dot_config/nvim/Readme.md b/dot_config/nvim/Readme.md index 5c78c4b..271d124 100644 --- a/dot_config/nvim/Readme.md +++ b/dot_config/nvim/Readme.md @@ -15,6 +15,7 @@ Yuan Neovim 備忘 * move cursor: (方向鍵) ### 擴充自行設定的快速鍵 +* `` 可以回朔到開啟檔案以來的任何歷史,還會標出修改的地方 * ``: NeoTree: 查看已經開啟的檔案 * ``: NeoTree * ``: git status @@ -22,7 +23,6 @@ Yuan Neovim 備忘 * `fB`: 已開啟的檔案 #### 預計設定 -* 可以回朔到開啟檔案以來的任何歷史,還會標出修改的地方 * 看看你設定了哪些變數、函數,也可以快速跳轉 ### 編輯習慣(已經覆寫) diff --git a/dot_config/nvim/exact_lua/exact_plugins/exact_components/undo.lua b/dot_config/nvim/exact_lua/exact_plugins/exact_components/undo.lua new file mode 100644 index 0000000..658cf7c --- /dev/null +++ b/dot_config/nvim/exact_lua/exact_plugins/exact_components/undo.lua @@ -0,0 +1,30 @@ +return { + { + "jiaoshijie/undotree", + dependencies = "nvim-lua/plenary.nvim", + config = true, + keys = { -- load the plugin only when using it's keybinding: + { "", "lua require('undotree').toggle()" }, + { "u", "lua require('undotree').toggle()" }, + }, + 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", + [''] = "action_enter", + ['p'] = "enter_diffbuf", + ['q'] = "quit", + }, + }, + } +}