Fzf: Emacs style keybindings

Created on 3 May 2015  路  9Comments  路  Source: junegunn/fzf

Could somebody please list all accessible keybindings in fzf and give an overview of their mappings?

tip

Most helpful comment

@junegunn is there any easy way to have Ctrl+K not for "up" action but for kill-line (emacs function name) ?

All 9 comments

https://github.com/junegunn/fzf/blob/master/src/terminal.go#L612-L740

Most of the emacs style keybindings I use are implemented in fzf, although CTRL-J and CTRL-K are shadowed by up and down motion. Do you see anything missing?

Ah, ok.

I have identified these ones:

| Key | Function | expect |
| --- | --- | --- |
| AltB | backward-word (r) | alt-b |
| AltF | forward-word (r) | alt-f |
| BTab | if multi: toggle, up-line | ? |
| CtrlA | beginning-of-line (r) | ctrl-a |
| CtrlB | backward-char (r) | ctrl-b |
| CtrlC | quit | ctrl-c |
| CtrlD | delete-char (r) && end-of-file (r)/quit | ctrl-d |
| CtrlE | end-of-line (r) | ctrl-e |
| CtrlF | forward-char (r) | ctrl-f |
| CtrlG | quit | ctrl-c |
| CtrlJ | down-line | ctrl-j |
| CtrlK | up-line | ctrl-k |
| CtrlL | redraw | ctrl-l |
| CtrlM | accept-line (r) | ctrl-m |
| CtrlN | down-line | ctrl-n |
| CtrlP | up-line | ctrl-p |
| CtrlQ | quit | ctrl-c |
| CtrlU | unix-line-discard (r) | ctrl-u |
| CtrlW | unix-word-rubout (r) | ctrl-w |
| CtrlY | yank (r) | ctrl-y |
| ESC | quit | na |
| PgDn | down-page | na |
| PgUp | up-page | na |
| Tab | if multi: toggle, down-line | ctrl-i |

And these here not:

| Del | delete-char (r) | ctrl-h (?) |
AltD
AltBS
CtrlH
Rune

And the kill ring has only one index, I guess (?)

Thanks for the summary.

| Key | Function (bind -p output) |
| --- | --- |
| AltD | kill-word |
| AltBS | backward-kill-word |
| CtrlH | backward-delete-char (equivalent to BS) |

("Rune" in the switch statement is not the name of a key but denoting a normal character)

As you have noticed, currently not all keys can be used with --expect option. Maybe I'll try to cover more on the next release.

And the kill ring has only one index, I guess (?)

Correct. I thought it would be an overkill to implement full readline compatibility, and I still think so.

Ok. cool

@junegunn is there any easy way to have Ctrl+K not for "up" action but for kill-line (emacs function name) ?

@pigmej Not currently. It will be possible when #238 is sorted out. By the way, do you frequently need ctrl-k? For me ctrl-u and ctrl-w almost always suffice.

@pigmej --bind option is now added to 0.9.12. You can use it like follows:

export FZF_DEFAULT_OPTS='--bind ctrl-k:kill-line'

@junegunn cool,

About your last question, it seems that I use crtl+k more than I even expected ;-) Usually for delete to the end of the line.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

firedev picture firedev  路  3Comments

ahmedelgabri picture ahmedelgabri  路  3Comments

aleclarson picture aleclarson  路  3Comments

sandric picture sandric  路  3Comments

olethanh picture olethanh  路  3Comments