diff --git a/modules/base/vim.nix b/modules/base/vim.nix index 0ef12f7..c6512b5 100644 --- a/modules/base/vim.nix +++ b/modules/base/vim.nix @@ -508,6 +508,16 @@ }, }, }, + extensions = { + -- Use vertical layout to allow enough width for + -- side-by-side diffs. + undo = { + layout_strategy = "vertical", + layout_config = { + preview_height = 0.8, + }, + }, + }, }) -- Keymaps mostly inspired by the popular distros. @@ -559,6 +569,22 @@ require("telescope").load_extension("ui-select") ''; } + # Visualize your undo tree and fuzzy-search changes in it. For those + # days where committing early and often doesn't work out. + # https://github.com/debugloop/telescope-undo.nvim + { + plugin = telescope-undo-nvim; + type = "lua"; + config = + /* + lua + */ + '' + local telescope = require("telescope") + telescope.load_extension("undo") + vim.keymap.set("n", "fu", telescope.extensions.undo.undo) + ''; + } # Buffer list that lives in the tabline. # https://github.com/akinsho/bufferline.nvim