Last active
December 24, 2024 10:29
-
-
Save romainl/7198a63faffdadd741e4ae81ae6dd9e6 to your computer and use it in GitHub Desktop.
Revisions
-
romainl revised this gist
Apr 24, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -6,11 +6,11 @@ Where the original `:DiffOrig` only shows differences between the buffer in memo * against the file on disk, like the original, with: :Diff * against an arbitrary Git revision of the current file, with: :Diff HEAD --- -
romainl revised this gist
Apr 24, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -6,11 +6,11 @@ Where the original `:DiffOrig` only shows differences between the buffer in memo * against the file on disk, like the original, with: :Diff * against an arbitrary Git revision of the current file, with: :Diff HEAD --- -
romainl revised this gist
Apr 13, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ function! Diff(spec) setlocal bufhidden=wipe buftype=nofile nobuflisted noswapfile let cmd = "++edit #" if len(a:spec) let cmd = "!git -C " . shellescape(fnamemodify(finddir('.git', '.;'), ':p:h:h')) . " show " . a:spec . ":#" endif execute "read " . cmd silent 0d_ -
romainl revised this gist
Apr 13, 2020 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,11 @@ function! Diff(spec) vertical new setlocal bufhidden=wipe buftype=nofile nobuflisted noswapfile let cmd = "++edit #" if len(a:spec) let cmd = "!git -C " . shellescape(fnamemodify(finddir('.git', '.;'), ':p:h')) . " show " . a:spec . ":#" endif execute "read " . cmd silent 0d_ diffthis wincmd p -
romainl revised this gist
Apr 12, 2020 . 1 changed file with 7 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,17 @@ # :DiffOrig but smarter This is an enhanced version of the snippet provided under `:help diff-original-file`. Where the original `:DiffOrig` only shows differences between the buffer in memory and the file on disk, `:Diff` can be used in two ways: * against the file on disk, like the original, with: :Diff * against an arbitrary Git revision of the current file, with: :Diff HEAD --- [My Vim-related gists](https://gist.github.com/romainl/4b9f139d2a8694612b924322de1025ce). -
romainl revised this gist
Apr 12, 2020 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ # :DiffOrig but smarter This `:Diff` command is an enhanced version of the snippet provided under `:help diff-original-file`. Where the original `:DiffOrig` only shows differences between the buffer in memory and the file on disk, this command can be used in two ways: -
romainl created this gist
Apr 12, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ This `:Diff` command is an enhanced version of the snippet provided under `:help diff-original-file`. Where the original `:DiffOrig` only shows differences between the buffer in memory and the file on disk, this command can be used in two ways: * against the file on disk, like the original, with: :Diff * against an arbitrary Git revision of the current file, with: :Diff HEAD 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ function! Diff(spec) vertical new setlocal bufhidden=wipe buftype=nofile nobuflisted noswapfile let cmd = "++edit" if len(a:spec) let cmd = "!git show " . a:spec . ":" endif execute "read " . cmd . "#" silent 0d_ diffthis wincmd p diffthis endfunction command! -nargs=? Diff call Diff(<q-args>)