Skip to content

Instantly share code, notes, and snippets.

@osa1
Last active September 4, 2018 07:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save osa1/626e0dda076378a55a8ef4b06d28108a to your computer and use it in GitHub Desktop.
Save osa1/626e0dda076378a55a8ef4b06d28108a to your computer and use it in GitHub Desktop.
Show commit hash in when viewing a commit in fugitive
diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim
index 1cc3d44..4a99b06 100644
--- a/autoload/fugitive.vim
+++ b/autoload/fugitive.vim
@@ -1524,7 +1524,7 @@ function! fugitive#BufReadCmd(...) abort
if b:fugitive_display_format
call s:ReplaceCmd([dir, 'cat-file', b:fugitive_type, rev])
else
- call s:ReplaceCmd([dir, 'show', '--no-color', '--pretty=format:tree%x20%T%nparent%x20%P%nauthor%x20%an%x20<%ae>%x20%ad%ncommitter%x20%cn%x20<%ce>%x20%cd%nencoding%x20%e%n%n%s%n%n%b', rev])
+ call s:ReplaceCmd([dir, 'show', '--no-color', '--pretty=format:commit%x20%H%ntree%x20%T%nparent%x20%P%nauthor%x20%an%x20<%ae>%x20%ad%ncommitter%x20%cn%x20<%ce>%x20%cd%nencoding%x20%e%n%n%s%n%n%b', rev])
keepjumps call search('^parent ')
if getline('.') ==# 'parent '
silent keepjumps delete_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment