mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-18 16:45:38 -05: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:
6
fzf
6
fzf
@@ -206,11 +206,11 @@ class FZF
|
||||
@expect = true
|
||||
when /^--expect=(.*)$/
|
||||
@expect = true
|
||||
when '--toggle-sort', '--tiebreak', '--color', '--bind'
|
||||
when '--toggle-sort', '--tiebreak', '--color', '--bind', '--history', '--history-max'
|
||||
argv.shift
|
||||
when '--tac', '--no-tac', '--sync', '--no-sync', '--hscroll', '--no-hscroll',
|
||||
'--inline-info', '--no-inline-info', /^--bind=(.*)$/,
|
||||
/^--color=(.*)$/, /^--toggle-sort=(.*)$/, /^--tiebreak=(.*)$/
|
||||
'--inline-info', '--no-inline-info', '--null', /^--bind=(.*)$/,
|
||||
/^--color=(.*)$/, /^--toggle-sort=(.*)$/, /^--tiebreak=(.*)$/, /^--history(-max)?=(.*)$/
|
||||
# XXX
|
||||
else
|
||||
usage 1, "illegal option: #{o}"
|
||||
|
||||
Reference in New Issue
Block a user