fzf icon indicating copy to clipboard operation
fzf copied to clipboard

Vim keybindings broken after fzf_cd

Open zbs opened this issue 2 years ago • 4 comments

  • [X] I have read through the manual page (man fzf)
  • [X] I have the latest version of fzf
  • [X] I have searched through the existing issues

Info

  • OS
    • [X] Linux
    • [ ] Mac OS X
    • [ ] Windows
    • [ ] Etc.
  • Shell
    • [X] bash
    • [ ] zsh
    • [ ] fish

Problem / Steps to reproduce

I cannot figure out the exact steps reliably, but I use tmux + vscode + vim keybindings. Through some sequence, I trigger the __fzf_cd__ mechanism, but after I cancel out of it, it breaks my vim keybindings: specifically, various vim navigations require pressing the same keys twice (e.g. CTRL + {, then K to go to previous command). I confirmed that set -o vi was being called in my bashrc before initializing fzf.

zbs avatar Sep 25 '23 22:09 zbs

Ok, figured out the repro steps: with vim keybindings, on a fresh line, do:

  1. ESC, or CTRL + [ to exit insert mode.
  2. Hit the letter C

After this point, basic functions like On an empty line, hit CTRL + [, then k to see the last command require pressing k twice.

zbs avatar Sep 29 '23 16:09 zbs

Ok, figured out the repro steps: with vim keybindings, on a fresh line, do:

  1. ESC, or CTRL + [ to exit insert mode.
  2. Hit the letter C

No ALT-C in the steps?

junegunn avatar Sep 30 '23 08:09 junegunn

Upon testing it again recently, it is WAI with ALT+C. I'm not sure what triggers it to enter this corrupted state, but when it does so, no ALT+C is required, just the steps listed above.

zbs avatar Oct 13 '23 15:10 zbs

Also having this issue! Pressing ESC to go from insert mode to normal mode and then quickly pressing C reliably triggers the __fzf_cd__ mechanism which is quite annoying.

MattyMay avatar Nov 22 '23 02:11 MattyMay