mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-01 04:32:05 -07:00
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
This commit is contained in:
@@ -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="
|
||||
|
Reference in New Issue
Block a user