Created
December 18, 2013 11:15
-
-
Save Altreus/8020689 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function! GitDiff() | |
let l:myft = &filetype | |
diffthis | |
" deal with submodules by temporarily changing to the file's dir | |
cd %:p:h | |
vnew | 0r !git show HEAD:./#:t | |
norm 1G | |
exec 'set ft=' . l:myft | |
set nomod ro | |
" q to get rid | |
map <buffer> q :quit<CR> :diffoff<CR> | |
diffthis | |
cd - | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment