diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2016-01-14 02:35:43 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2016-01-14 02:35:43 +0900 |
commit | f6c6e59a50d580595fd5117ab51b058988fc5f83 (patch) | |
tree | 13051b91ef1f667a3860d5c66d8161503bd573c4 /src/options.go | |
parent | 45143f9541d55c5efdadc7ea8acd9474a19eb8c6 (diff) |
Add toggle-in and toggle-out for --bind
Related: #452
When `--multi` is set, tab key will bring your cursor down, and
shift-tab up. But since fzf by default draws the screen in bottom-up
fashion, one may feel that the opposite of the behavior is more
desirable and choose to customize the key bindings as follows.
export FZF_DEFAULT_OPTS="--bind tab:toggle-up,shift-tab:toggle-down"
This configuration, however, becomes no longer straightforward when
`--reverse` is set and fzf switches to top-down layout. To address the
requirement, this commit adds `toggle-in` and `toggle-out` option which
switch direction depending on `--reverse`-ness.
export FZF_DEFAULT_OPTS="--bind tab:toggle-out,shift-tab:toggle-in"
Diffstat (limited to 'src/options.go')
-rw-r--r-- | src/options.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/options.go b/src/options.go index 6399343c..962e516e 100644 --- a/src/options.go +++ b/src/options.go @@ -566,6 +566,10 @@ func parseKeymap(keymap map[int]actionType, execmap map[int]string, toggleSort b keymap[key] = actToggleDown case "toggle-up": keymap[key] = actToggleUp + case "toggle-in": + keymap[key] = actToggleIn + case "toggle-out": + keymap[key] = actToggleOut case "toggle-all": keymap[key] = actToggleAll case "select-all": |