Created
January 5, 2015 19:12
-
-
Save habahut/44ecf9c968dfd6c1fb8b to your computer and use it in GitHub Desktop.
Diff Saved Vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nnoremap <leader>D :DiffSaved<cr> | |
function! s:DiffWithSaved() | |
let filetype=&ft | |
diffthis | |
vnew | r # | normal! 1Gdd | |
diffthis | |
exe "setlocal bt=nofile bh=wipe nobl noswf ro ft=" . filetype | |
endfunction | |
com! DiffSaved call s:DiffWithSaved() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment