pindexis / qfc

Quick Command-line File Completion
MIT License
574 stars 23 forks source link

Binds don't work in vi-mode #9

Open ahills opened 9 years ago

ahills commented 9 years ago

BASH_VERSION is 4.3.33(1)-release. Pressing ^F just inserts ^F. Running set -o emacs causes qfc to work as expected.

rafi commented 9 years ago

Works for me in vi-mode, bash 4.3.39.

slowkow commented 9 years ago

Also works for me in vi-mode.

bash --version
GNU bash, version 4.3.33(1)-release (x86_64-apple-darwin13.4.0)
pindexis commented 9 years ago

When you type set -o vi . Ctrl-f will be overridden by vi keybinding for that key-sequence(which is self-insert in this case). So you have to resource .bashrc for it to works.

I guess that's your issue

ahills commented 9 years ago

Unfortunately, set -o vi is in my profile at the very beginning, and the bind is added at the end of my .bashrc. Setting the mode to emacs makes it work right away without sourcing again, and setting it back to vi turns it off. How can I force the bind to apply to vi-mode?

slowkow commented 9 years ago

The way I set vi-mode is by editing my Readline init file ~/.inputrc file like this:

set editing-mode vi

See more here: https://www.gnu.org/software/bash/manual/html_node/Readline-Init-File-Syntax.html#Readline-Init-File-Syntax

This way, you can avoid executing set -o vi in your ~/.bashrc file.

ahills commented 9 years ago

That would enable vi-mode for all my readline programs.