From 13f044cc4dff561ac1e3d860c9a30925fff50c35 Mon Sep 17 00:00:00 2001 From: johannst Date: Fri, 10 Nov 2017 13:18:56 +0100 Subject: vimrc: added keymap for diff open windows and diffoff all diffs + added diff status in statusline --- vimrc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vimrc b/vimrc index 0f95cfe..87df409 100644 --- a/vimrc +++ b/vimrc @@ -169,6 +169,8 @@ augroup end set clipboard=unnamed " additionally use (") register as clipboard to (+) register nnoremap w :set wrap! +nnoremap dw :windo diffthis +nnoremap dn :diffoff! "}}} "{{{ Default Keymap Shadow @@ -317,11 +319,19 @@ function! DynamicStatuslineHighlighting() return '' endfunction +function! GetDiffStatus() + if (&diff) + return 'diff' + else + return '' +endfunction + let &statusline='' let &statusline.='%{DynamicStatuslineHighlighting()}' let &statusline.='[%{g:ModeMap[mode()]}]' let &statusline.=' %t' " file name let &statusline.=' {%M%R%H}' " modified/read-only/help-page +let &statusline.=' [%{GetDiffStatus()}]' let &statusline.=' [%{&ft}]' "filetype let &statusline.='%=' " seperator between left and right alignment -- cgit v1.2.3