aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2022-08-31 15:24:40 -0500
committerToby Vincent <tobyv13@gmail.com>2022-08-31 15:24:40 -0500
commit5140754851bdb2ecf67d215b66bcc1e272791fea (patch)
tree814d9f69726594ecd35d63852a18724d1f69affa
parent7a9c73d7748c80623a81767c95bb8e364cdd46a3 (diff)
feat(nvim): add config for undotree
-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