about summary refs log tree commit diff
path: root/modules
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2015-12-08 21:17:30 +0100
committeraszlig <aszlig@redmoonstudios.org>2015-12-08 21:17:30 +0100
commitc6db19b35716fd5645570f1613fcbf30cd702036 (patch)
tree568b5e03a873ec79a404a8b4286e797ad0e8f864 /modules
parent20225bda26bc4d9c73a7cd536b37b82ee445eb2f (diff)
programs/vim: Add DiffOrig command.
Especially useful if you get a kernel panic and have swapfiles laying
around. This command is actually from the Vim example config file and is
documented in the diff-original-file help of Vim.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'modules')
-rw-r--r--modules/user/aszlig/programs/vim/default.nix3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/user/aszlig/programs/vim/default.nix b/modules/user/aszlig/programs/vim/default.nix
index afeedf26..791c4d5a 100644
--- a/modules/user/aszlig/programs/vim/default.nix
+++ b/modules/user/aszlig/programs/vim/default.nix
@@ -348,6 +348,9 @@ let
       endfor
     endfun
 
+    command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
+      \ | wincmd p | diffthis
+
     " flake everything that has been *detected* as python (not just by suffix).
     autocmd BufWritePost * if &ft ==# 'python' | call Flake8() | endif
   '';