Skip to content

Commit 9efa7d0

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 6ddebc5 commit 9efa7d0

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Upcoming Release (TBD)
44
Features
55
--------
66
* Make control-r reverse search style configurable.
7+
* Make fzf search key bindings more compatible with traditional isearch.
78

89

910
Internal

mycli/packages/toolkit/fzf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def search_history(event: KeyPressEvent, incremental: bool = False) -> None:
4747

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

5353
if result:

0 commit comments

Comments
 (0)