aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/nvim
diff options
context:
space:
mode:
Diffstat (limited to 'nvim')
-rw-r--r--nvim/.config/nvim/lua/tobyvin/plugins.lua3
-rw-r--r--nvim/.config/nvim/lua/tobyvin/plugins/undotree.lua13
2 files changed, 14 insertions, 2 deletions
diff --git a/nvim/.config/nvim/lua/tobyvin/plugins.lua b/nvim/.config/nvim/lua/tobyvin/plugins.lua
index 892ee5e..9119064 100644
--- a/nvim/.config/nvim/lua/tobyvin/plugins.lua
+++ b/nvim/.config/nvim/lua/tobyvin/plugins.lua
@@ -381,9 +381,8 @@ M.plugins = function(use)
use({
"mbbill/undotree",
- cmd = "UndotreeToggle",
config = function()
- vim.g.undotree_SetFocusWhenToggle = 1
+ require("tobyvin.plugins.undotree").setup()
end,
})
diff --git a/nvim/.config/nvim/lua/tobyvin/plugins/undotree.lua b/nvim/.config/nvim/lua/tobyvin/plugins/undotree.lua
new file mode 100644
index 0000000..976a053
--- /dev/null
+++ b/nvim/.config/nvim/lua/tobyvin/plugins/undotree.lua
@@ -0,0 +1,13 @@
+local M = {}
+
+M.setup = function()
+ local status_ok, undotree = pcall(require, "undotree")
+ if not status_ok then
+ vim.notify("Failed to load module 'undotree'", "error")
+ return
+ end
+
+ vim.keymap.set("n", "<leader>u", undotree.toggle, { desc = "Toggle undotree" })
+end
+
+return M