leo-arch / clifm

The shell-like, command line terminal file manager: simple, fast, extensible, and lightweight as hell.
https://github.com/leo-arch/clifm/wiki
GNU General Public License v2.0
1.29k stars 41 forks source link

Readline vi-mode remapping compatibility #259

Closed vanya-robertson closed 9 months ago

vanya-robertson commented 9 months ago

I am a non-QWERTY user who cannot make vi-mode remaps in readline.cfg. Behaviour seems the same, no matter what I try.

I would welcome any solution.

Thank you, Vanya

leo-arch commented 9 months ago

Hi Vanya, thanks for reporting. What are you trying to accomplish exactly? A concrete example would be really useful to carry out a few tests. Btw, do you mean readline.clifm, isn't it?

EDIT: Is the INPUTRC environment variable defined in your system? If yes, this is why readline.clifm isn't read at all (try removing this variable from your environment, or run in secure-environment mode via --secure-env).

vanya-robertson commented 9 months ago

Hi, Leo.

INPUTRC is not defined.

In readline.clifm, i have these lines:

$if mode=vi                                      
    set keymap vi-move                                 
    "i": backward-char
$endif 

Esc does enter me into vi-mode, as the qwerty keybindings work. I would like to remap i to backward-char, but there is no change in behaviour.

leo-arch commented 9 months ago

Have you been able to do this in Bash (via ~/.inputrc)? I've tried and failed. The point is: is this issue clifm-specific?

vanya-robertson commented 9 months ago

When set in .inputrc, it works in bash, python and tasksh, all readline programs; it does seem to be clifm-specific.

I can unbind the hjkl keys in readline.clifm:

$if mode=vi                                      
    set keymap vi-move
    "h":
    "j":
    "k":
    "l":
    "i": backward-char
$endif 
leo-arch commented 9 months ago

I'll keep investigating.

vanya-robertson commented 9 months ago

Thanks, man

leo-arch commented 9 months ago

Hey @vanya-robertson, made a little modification. Could you give it a try now?

vanya-robertson commented 9 months ago

Works perfectly, you absolute legend.