From 3b5281179639811eb9a1e5fde8aeed1264f842ed Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 14 Jun 2015 00:43:44 +0900 Subject: Add support for search history - Add `--history` option (e.g. fzf --history ~/.fzf.history) - Add `--history-max` option for limiting the size of the file (default 1000) - Add `previous-history` and `next-history` actions for `--bind` - CTRL-P and CTRL-N are automatically remapped to these actions when `--history` is used Closes #249, #251 --- shell/completion.bash | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'shell/completion.bash') diff --git a/shell/completion.bash b/shell/completion.bash index 59bdfe46..42d66c1d 100644 --- a/shell/completion.bash +++ b/shell/completion.bash @@ -45,7 +45,10 @@ _fzf_opts_completion() { --print-query --expect --toggle-sort - --sync" + --sync + --null + --history + --history-max" case "${prev}" in --tiebreak) @@ -56,6 +59,10 @@ _fzf_opts_completion() { COMPREPLY=( $(compgen -W "dark light 16 bw" -- ${cur}) ) return 0 ;; + --history) + COMPREPLY=() + return 0 + ;; esac if [[ ${cur} =~ ^-|\+ ]]; then @@ -207,7 +214,7 @@ EOF } # fzf options -complete -F _fzf_opts_completion fzf +complete -o default -F _fzf_opts_completion fzf d_cmds="cd pushd rmdir" f_cmds=" -- cgit v1.2.3