From d0042b9dee7a5cb1482ddcd910d26cf0ceec601d Mon Sep 17 00:00:00 2001 From: Niraj Thapaliya Date: Thu, 23 Nov 2017 22:18:55 -0600 Subject: [PATCH] [[B]Commit] Fix preview command for fish shell (#518) * Fish shell doesn't like <<< Echo to pipe instead * Only return the first match Useful if the commit message has a project tracker id that looks similar to a git commit hash --- autoload/fzf/vim.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/fzf/vim.vim b/autoload/fzf/vim.vim index 7839916..1c3b0c7 100644 --- a/autoload/fzf/vim.vim +++ b/autoload/fzf/vim.vim @@ -1124,7 +1124,7 @@ function! s:commits(buffer_local, args) if !s:is_win && &columns > s:wide call extend(options.options, - \ ['--preview', 'grep -o "[a-f0-9]\{7,\}" <<< {} | xargs git show --format=format: --color=always | head -200']) + \ ['--preview', 'echo {} | grep -o "[a-f0-9]\{7,\}" | head -1 | xargs git show --format=format: --color=always | head -200']) endif return s:fzf(a:buffer_local ? 'bcommits' : 'commits', options, a:args)