Fzf: Can I change the CTRL-HJKL bindings?

Created on 31 Mar 2015  路  8Comments  路  Source: junegunn/fzf

Hey! I'm a big vim/tmux/zsh user, and I have a custom tmux config setup that lets me switch between tmux panes using CTRL + HJKL movements.

So I'd like to remap the CTRL-HJKL bindings for fzf to use something different... Is this possible? I tried looking here:

https://github.com/junegunn/fzf#using-the-finder

and editing the following file:

~/.fzf/shell/key-bindings.zsh

but couldn't see a way to do it... thanks!

Most helpful comment

It's now possible in 0.9.12 with --bind option:

export FZF_DEFAULT_OPTS='--bind alt-j:down,alt-k:up'

All 8 comments

Nope, remapping of keys are not supported at the moment.

By the way, if I understood you correctly, you have CTRL + HJKL bindings on your tmux config, and they should shadow the same key bindings from fzf. Then what exactly is your problem and what do you want to achieve? If being unable to use CTRL-JK from fzf is the problem, you can use CTRL-NP or arrow keys instead, and backspace is equivalent to CTRL-H. CTRL-L redraws fzf screen, but it's undocumented and rarely needed.

hey.... i was hoping to be able to switch them to more VIM like keystrokes if possible... Since using CTRL-JK clashes with my current tmux config. Maybe ALT-JK was what I was hoping, but no worries... I'll just use CTRL-NP instead.... much appreciated! and fzf seems awesome so far, so thanks for the great work!

I see, maybe I'll consider allowing remapping of the keys in the future, but most of the keys (except for CTRL-JK!) are strictly based on the default readline keybindings, so it's not really urgent I guess. And hey, one can say that CTRL-NP are equally as vim-like as JK (they're for auto-completion) :sunglasses:

It's now possible in 0.9.12 with --bind option:

export FZF_DEFAULT_OPTS='--bind alt-j:down,alt-k:up'

cool... thanks... definitely a nice feature.... much appreciated!

@junegunn this might not be entirely on topic for this issue but I have export FZF_DEFAULT_OPTS='--bind ctrl-h:down,ctrl-t:up' so of course ctrl-t opens in a tab instead of going up. Is there a way to disable or remap ctrl-t. It looks like this issue somewhat addresses it but possibly in a different context.

@fzf You mean in Vim? If that's what you're saying, you should check out g:fzf_action. See https://github.com/junegunn/fzf/blob/master/README-VIM.md#configuration

you guys are amazing :amaze:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jberglinds picture jberglinds  路  3Comments

olethanh picture olethanh  路  3Comments

skamsie picture skamsie  路  3Comments

sassanh picture sassanh  路  3Comments

jan-warchol picture jan-warchol  路  3Comments