mirror of
https://github.com/junegunn/fzf.vim.git
synced 2025-12-06 12:44:24 +08:00
[[B]Commits] Use delta if available
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 `git diff` output
|
||||
- If {delta}{6} 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)}{7}
|
||||
- `Rg` requires {ripgrep (rg)}{8}
|
||||
- `Tags` and `Helptags` require Perl
|
||||
|
||||
Reference in New Issue
Block a user