diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2015-05-21 01:35:35 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-05-21 01:37:16 +0900 |
commit | 801cf9ac6241dc4a01a5f4ba87fcc9746c15a20e (patch) | |
tree | 706ae5e7a43421e81464759e125c108a1985b6ce | |
parent | 34946b72a5e5a3d3c5c31fef4b373dcbc7b3821f (diff) |
Add unbound "toggle" action for customization
-rw-r--r-- | man/man1/fzf.1 | 5 | ||||
-rw-r--r-- | src/options.go | 2 | ||||
-rw-r--r-- | src/terminal.go | 6 |
3 files changed, 11 insertions, 2 deletions
diff --git a/man/man1/fzf.1 b/man/man1/fzf.1 index a696cb7c..86f07deb 100644 --- a/man/man1/fzf.1 +++ b/man/man1/fzf.1 @@ -181,12 +181,13 @@ e.g. \fBfzf --bind=ctrl-j:accept,ctrl-k:kill-line\fR end-of-line forward-char forward-word - kill-line + kill-line (not bound) kill-word page-down page-up + toggle (not bound) toggle-down - toggle-sort + toggle-sort (not bound; equivalent to \fB--toggle-sort\fR) toggle-up unix-line-discard unix-word-rubout diff --git a/src/options.go b/src/options.go index abae6f37..d0014a7b 100644 --- a/src/options.go +++ b/src/options.go @@ -344,6 +344,8 @@ func parseKeymap(keymap map[int]actionType, toggleSort bool, str string) (map[in keymap[key] = actToggleDown case "toggle-up": keymap[key] = actToggleUp + case "toggle": + keymap[key] = actToggle case "down": keymap[key] = actDown case "up": diff --git a/src/terminal.go b/src/terminal.go index 1a78fed9..9099576a 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -105,6 +105,7 @@ const ( actUnixWordRubout actYank actBackwardKillWord + actToggle actToggleDown actToggleUp actDown @@ -724,6 +725,11 @@ func (t *Terminal) Loop() { t.input = append(t.input[:t.cx-1], t.input[t.cx:]...) t.cx-- } + case actToggle: + if t.multi && t.merger.Length() > 0 { + toggle() + req(reqList) + } case actToggleDown: if t.multi && t.merger.Length() > 0 { toggle() |