From ad4e1e569119167d2a2e56e2efeba920277858c5 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sat, 22 Oct 2016 12:58:24 +0900 Subject: [PATCH] [GFiles?] Wrap preview command in sh -c To avoid errors when $SHELL is not posix-compliant. Close #224. --- 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 b2aeb47..0610461 100644 --- a/autoload/fzf/vim.vim +++ b/autoload/fzf/vim.vim @@ -422,7 +422,7 @@ function! fzf#vim#gitfiles(args, ...) let wrapped = fzf#wrap({ \ 'source': 'git -c color.status=always status --short --untracked-files=all', \ 'dir': root, - \ 'options': '--ansi --multi --nth 2..,.. --prompt "GitFiles?> " --preview ''(git diff --color=always -- {-1} | sed 1,4d; cat {-1}) | head -500''' + \ 'options': '--ansi --multi --nth 2..,.. --prompt "GitFiles?> " --preview ''sh -c "(git diff --color=always -- {-1} | sed 1,4d; cat {-1}) | head -500"''' \}) call s:remove_layout(wrapped) let wrapped.common_sink = remove(wrapped, 'sink*')