diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2015-06-14 00:43:44 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-06-14 00:48:48 +0900 |
commit | 3b5281179639811eb9a1e5fde8aeed1264f842ed (patch) | |
tree | 5539de2aed75ccf93bbe9a08fcbb9030d6e5ea43 /shell | |
parent | 2e84b1db6421d046b532d4df204b3ba6a02dcbda (diff) |
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
Diffstat (limited to 'shell')
-rw-r--r-- | shell/completion.bash | 11 |
1 files changed, 9 insertions, 2 deletions
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=" |