Skip to content

Commit c2bc44b

Browse files
committed
bind ctrl-r/alt-r to previous-item in fzf search
Bind the keys which may initiate an fzf-based reverse search to also iterating upward through the matched items, once we are in fzf mode. This makes fzf search more closely match the keyboard muscle memory of traditional reverse incremental search (though it may look very different visually). Like #1278 this is intended to address * #1265 (comment) This also assumes that alt-r from #1278 can initiate an fzf search.
1 parent 9379f4e commit c2bc44b

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Upcoming Release (TBD)
22
======================
33

4+
Features
5+
--------
6+
* Make fzf search key bindings more compatible with traditional isearch.
7+
8+
49
Internal
510
--------
611

mycli/packages/toolkit/fzf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def search_history(event: KeyPressEvent):
4343

4444
result = fzf.prompt(
4545
formatted_history_items,
46-
fzf_options="--scheme=history --tiebreak=index --preview-window=down:wrap --preview=\"printf '%s' {}\"",
46+
fzf_options="--scheme=history --tiebreak=index --bind ctrl-r:up,alt-r:up --preview-window=down:wrap --preview=\"printf '%s' {}\"",
4747
)
4848

4949
if result:

0 commit comments

Comments
 (0)