From e3fbb7b50829892603a47752dde115362ac6beb8 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Thu, 25 May 2017 19:22:43 +0200 Subject: [PATCH] fish/fzf: Lift the (__fzfcmd) workaround since fish 2.6 fixes it --- .config/fish/fzf.fish | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.config/fish/fzf.fish b/.config/fish/fzf.fish index b7ccbe15..4e81c0dc 100644 --- a/.config/fish/fzf.fish +++ b/.config/fish/fzf.fish @@ -62,9 +62,8 @@ bind -M insert \t fzf-complete bind -M insert \e\t complete function fzf-bcd-widget -d 'cd backwards' - ## TODO: (fish upsteam bug) Cannot use eval here. - # pwd | awk -v RS=/ '/\n/ {exit} {p=p $0 "/"; print p}' | tac | eval (__fzfcmd) +m --select-1 --exit-0 $FZF_BCD_OPTS | read -l result - pwd | awk -v RS=/ '/\n/ {exit} {p=p $0 "/"; print p}' | tac | fzf +m --select-1 --exit-0 --preview='preview {}' | read -l result + set -lx FZF_DEFAULT_OPTS "$FZF_DEFAULT_OPTS $FZF_BCD_OPTS" + pwd | awk -v RS=/ '/\n/ {exit} {p=p $0 "/"; print p}' | tac | eval (__fzfcmd) +m --select-1 --exit-0 | read -l result [ "$result" ]; and cd $result commandline -f repaint end @@ -81,9 +80,8 @@ function fzf-cdhist-widget -d 'cd to one of the previously visited locations' end end set dirprev $buf - ## TODO: (fish upsteam bug) Cannot use eval here. - # string join \n $dirprev | tac | sed 1d | eval (__fzfcmd) +m $FZF_CDHIST_OPTS | read -l result - string join \n $dirprev | tac | sed 1d | fzf +m --preview='preview {}' | read -l result + set -lx FZF_DEFAULT_OPTS "$FZF_DEFAULT_OPTS $FZF_CDHIST_OPTS" + string join \n $dirprev | tac | sed 1d | eval (__fzfcmd) +m --tiebreak=index --toggle-sort=ctrl-r | read -l result [ "$result" ]; and cd $result commandline -f repaint end