From e3bf9306c4733f49a5ab9ba0a52555b60c0eb6d5 Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Thu, 28 Dec 2023 16:23:44 +0100 Subject: [PATCH] neovim: add peristant undo file --- home/neovim.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/home/neovim.nix b/home/neovim.nix index 61cbb19..fbfae80 100644 --- a/home/neovim.nix +++ b/home/neovim.nix @@ -1,5 +1,7 @@ { pkgs, lib, inputs, config, ...}: -{ +let + undoDir = "${config.home.homeDirectory}/.vim/undo"; +in { programs.neovim = { enable = true; defaultEditor = true; @@ -41,6 +43,11 @@ set tabstop=2 set expandtab + set undofile + set undodir=${undoDir} + set undolevels=1000 + set undoreload=10000 + " Integrate status with lightline let g:lightline = { \ 'active': { @@ -117,4 +124,7 @@ map :noh ''; }; + + # Create undo directory + home.activation.vimUndoDir = lib.hm.dag.entryAfter ["writeBoundary"] "mkdir -p ${undoDir}"; }