From 82421cba371283b7c8fc456bc7850f55a277a9cd Mon Sep 17 00:00:00 2001 From: Arti Zirk Date: Tue, 27 Jul 2021 17:31:29 +0300 Subject: [PATCH] Add vim swap file support --- .config/nvim/swap.vim | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .config/nvim/swap.vim diff --git a/.config/nvim/swap.vim b/.config/nvim/swap.vim new file mode 100644 index 0000000..1666912 --- /dev/null +++ b/.config/nvim/swap.vim @@ -0,0 +1,20 @@ +" Protect changes between writes. Default values of +" updatecount (200 keystrokes) and updatetime +" (4 seconds) are fine +set swapfile +set directory^=~/.config/nvim/swap// + +" protect against crash-during-write +set writebackup +" but do not persist backup after successful write +set nobackup +" use rename-and-write-new method whenever safe +set backupcopy=auto + +" consolidate the writebackups -- not a big +" deal either way, since they usually get deleted +set backupdir^=~/.config/nvim/backup// + +" persist the undo tree for each file +set undofile +set undodir^=~/.config/nvim/undo//