[[B]Commits] Use delta if available

This commit is contained in:
Junegunn Choi
2020-12-14 00:12:22 +09:00
parent 65b6cdb0f2
commit 54b3817db2
3 changed files with 7 additions and 4 deletions

View File

@@ -52,7 +52,8 @@ so you can omit it if you use a plugin manager that doesn't support hooks.
- [fzf][fzf-main] 0.23.0 or above
- For syntax-highlighted preview, install [bat](https://github.com/sharkdp/bat)
- `:GF?` will use [delta](https://github.com/dandavison/delta) if available
- If [delta](https://github.com/dandavison/delta) is available, `:GF?`,
`:Commits` and `:BCommits` will use it to format `git diff` output.
to format `git diff` output
- `Ag` requires [The Silver Searcher (ag)][ag]
- `Rg` requires [ripgrep (rg)][rg]

View File

@@ -1221,8 +1221,9 @@ function! s:commits(buffer_local, args)
endif
if !s:is_win && &columns > s:wide
let suffix = executable('delta') ? '| delta' : '--color=always'
call extend(options.options,
\ ['--preview', 'echo {} | grep -o "[a-f0-9]\{7,\}" | head -1 | xargs git show --format=format: --color=always | head -1000'])
\ ['--preview', 'echo {} | grep -o "[a-f0-9]\{7,\}" | head -1 | xargs git show --format=format: ' . suffix])
endif
return s:fzf(a:buffer_local ? 'bcommits' : 'commits', options, a:args)

View File

@@ -1,4 +1,4 @@
fzf-vim.txt fzf-vim Last change: December 12 2020
fzf-vim.txt fzf-vim Last change: December 14 2020
FZF-VIM - TABLE OF CONTENTS *fzf-vim* *fzf-vim-toc*
==============================================================================
@@ -92,7 +92,8 @@ so you can omit it if you use a plugin manager that doesn't support hooks.
- {fzf}{1} 0.23.0 or above
- For syntax-highlighted preview, install {bat}{5}
- `:GF?` will use {delta}{6} if available to format `gitdiff` output
- If {delta}{6} is available, `:GF?`, `:Commits` and `:BCommits` will use it to
format `gitdiff` output. to format `gitdiff` output
- `Ag` requires {The Silver Searcher (ag)}{7}
- `Rg` requires {ripgrep (rg)}{8}
- `Tags` and `Helptags` require Perl