From fcccd17d45e55a11c6e504cde345e03cff20b66e Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Tue, 16 Apr 2013 22:19:46 -0500 Subject: [PATCH] .vimrc: Add DiffToggle() Taken from: http://www.bestofvim.com/tip/diff-diff/ --- .vimrc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.vimrc b/.vimrc index 234fe8b..f3724a5 100644 --- a/.vimrc +++ b/.vimrc @@ -257,6 +257,16 @@ function! StripWhitespace () endfunction map s :call StripWhitespace () +" toggle diffmode for a buffer +function! DiffToggle() + if &diff + diffoff + else + diffthis + endif +endfunction +nnoremap df :call DiffToggle() + " ---------------------------------------------------------------------------- " Auto Commands " ---------------------------------------------------------------------------- -- 2.47.1