summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2014-12-13 11:10:29 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2014-12-13 11:10:29 +0900
commitd38f7a5eb5348859786ff96b96a35eade0e2b0e5 (patch)
tree9f1136c138a835250c8c9f92d2f30496f28a54ea
parentd89c9e94bac3f7a493b18b96a2f2aa530fa5f116 (diff)
parentee433ef6e9b8ab2860ca93dd39ed110fc79bf60e (diff)
downloadfzf-d38f7a5eb5348859786ff96b96a35eade0e2b0e5.tar.gz
Merge pull request #109 from brettanomyces/reorder_fish_history
Reverse the order of fish history
-rwxr-xr-xinstall10
1 files changed, 9 insertions, 1 deletions
diff --git a/install b/install
index f912091e..3176b27d 100755
--- a/install
+++ b/install
@@ -294,8 +294,16 @@ function fzf_key_bindings
rm -f $TMPDIR/fzf.result
end
+ function __fzf_reverse
+ if which tac > /dev/null
+ tac $argv
+ else
+ tail -r $argv
+ end
+ end
+
function __fzf_ctrl_r
- history | fzf +s +m > $TMPDIR/fzf.result
+ history | __fzf_reverse | fzf +s +m > $TMPDIR/fzf.result
and commandline (cat $TMPDIR/fzf.result)
commandline -f repaint
rm -f $TMPDIR/fzf.result