From 93c3ab5dc64ad6227c0e87d61cbdc5feaa390aa0 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Sun, 7 Jul 2024 12:13:36 +0300 Subject: Neovim: added undotree plugin, undos now persist to files --- .config/nvim/lua/custom/plugins/utility.lua | 6 ++++++ .config/nvim/lua/options.lua | 1 + 2 files changed, 7 insertions(+) (limited to '.config/nvim/lua') diff --git a/.config/nvim/lua/custom/plugins/utility.lua b/.config/nvim/lua/custom/plugins/utility.lua index 53a8c06..2d2a93a 100644 --- a/.config/nvim/lua/custom/plugins/utility.lua +++ b/.config/nvim/lua/custom/plugins/utility.lua @@ -43,4 +43,10 @@ return { ft = 'lua', opts = { library = { { path = 'luvit-meta/library', words = { 'vim%.uv' } } } }, }, + { + 'mbbill/undotree', + config = function() + vim.keymap.set('n', 'ut', vim.cmd.UndotreeToggle) + end, + }, } diff --git a/.config/nvim/lua/options.lua b/.config/nvim/lua/options.lua index 8fecc36..85153de 100644 --- a/.config/nvim/lua/options.lua +++ b/.config/nvim/lua/options.lua @@ -5,6 +5,7 @@ vim.g.maplocalleader = ' ' vim.g.have_nerd_font = true vim.opt.mouse = 'a' -- enable mouse vim.opt.clipboard = 'unnamedplus' -- use system clipboard +vim.opt.undofile = true -- Persist undo history by saving it to a file -- Tab vim.opt.expandtab = true -- convert tabs to spaces -- cgit v1.3.1