Skip to content
Myr

Fix Bash+vimode pre-launch delay

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Summary: Fix adapted from [@adamheins: fzf, vi-mode, and fixing delays][1]. [1]: https://adamheins.com/blog/fzf-vi-mode-and-fixing-delays The basic problem is that fzf presses <Esc> to enter vi-movement-mode (as opposed to insert mode) and then presses a bunch of keys to set up the buffer. But the <Esc> keypress is also the prefix for a bunch of other commands, so Bash will dutifully wait an excruciating half-second before actually executing this command. Instead, we bind <C-x><C-a>, which is unused by default and seems reasonably unlikely to be custom-bound, to be another way to enter vi-movement-mode; this binding is unambiguous, so fzf can use it without delay. This change was made by just `:s/\\e/\\C-x\\C-a/gc` in the relevant section, after adding the actual binding and comment at the top.

authored by William Chargin · committed by William Chargin · parent 935e986 · Browse files · 1 file+14 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+14 added−5 removed

  • other:+14 added−5 removed

1 file+14 added−5 removed

modified:shell/key-bindings.bash+14 added-5 removed