-
-
Notifications
You must be signed in to change notification settings - Fork 587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GF? with delta #1202
Comments
You mean How about this? diff --git a/autoload/fzf/vim.vim b/autoload/fzf/vim.vim
index cebb2fe..0eda8d6 100644
--- a/autoload/fzf/vim.vim
+++ b/autoload/fzf/vim.vim
@@ -623,10 +623,14 @@ function! fzf#vim#gitfiles(args, ...)
" Here be dragons!
" We're trying to access the common sink function that fzf#wrap injects to
" the options dictionary.
+
+ let preview = executable('delta')
+ \ ? 'sh -c "git diff -- {-1} | delta"'
+ \ : 'sh -c "git diff --color=always -- {-1} | sed 1,4d; cat {-1}"'
let wrapped = fzf#wrap({
\ 'source': 'git -c color.status=always status --short --untracked-files=all',
\ 'dir': root,
- \ 'options': ['--ansi', '--multi', '--nth', '2..,..', '--tiebreak=index', '--prompt', 'GitFiles?> ', '--preview', 'sh -c "(git diff --color=always -- {-1} | sed 1,4d; cat {-1}) | head -1000"']
+ \ 'options': ['--ansi', '--multi', '--nth', '2..,..', '--tiebreak=index', '--prompt', 'GitFiles?> ', '--preview', preview]
\})
call s:remove_layout(wrapped)
let wrapped.common_sink = remove(wrapped, 'sink*') |
Yes I mean |
@junegunn thanks for change but there is is a problem, I get the following messages |
Oh yeah, |
Fixed, thanks 😃 |
man fzf
)Could there be a possibility to use delta in the
GStatus?
to do the diff?I've seen some examples using fzf-preview.vim but I think it could be convenient to have it directly in
fzf.vim
without having to install other pluginsHere the example that I found:
Update:
Modifying line 629 I was able to get the result but it is not conservative if someone does not use delta.
Thanks for your help
The text was updated successfully, but these errors were encountered: