m/fzf
1
0
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:
Junegunn Choi
2015-06-14 00:43:44 +09:00
parent 2e84b1db64
commit 3b52811796
6 changed files with 163 additions and 11 deletions

6
fzf
View File

@@ -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}"