bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Disable default TAB in vi mode


From: Sam Habiel
Subject: Re: Disable default TAB in vi mode
Date: Fri, 06 Oct 2023 13:20:00 -0400
User-agent: Zoho Mail

I had the hardest time with the compiler and typing when dlsymming 
vi_insertion_keymap (the types the compiler wanted didn't agree with the type 
of the parameter); but when I looked in the readline source code, I found a 
another solution that will work for both emacs and vi:

in rl_startup_hook:

Keymap          current_readline_keymap;

current_readline_keymap = rl_get_keymap();
rl_bind_key_in_map('\t', rl_insert, current_readline_keymap);

Problem solved.

Thank you.

--Sam


 ---- On Thu, 05 Oct 2023 09:30:20 -0400  Chet Ramey  wrote --- 
 > On 9/29/23 11:29 AM, Sam Habiel wrote:
 > > The documentation says this:
 > > 
 > >> Thus, to disable the default TAB behavior, the following suffices:
 > >> rl_bind_key ('\t', rl_insert);
 > > 
 > > This indeed works for emacs mode; but apparently it doesn't work for vi 
 > > mode. Any tips on how to achieve the same for vi mode?
 > 
 > That call modifies the current keymap. If you want to ensure that you
 > change it for vi mode, use something like
 > 
 > rl_bind_key_in_map ('\t', rl_insert, vi_insertion_keymap);
 > 
 > 
 > -- 
 > ``The lyf so short, the craft so long to lerne.'' - Chaucer
 >          ``Ars longa, vita brevis'' - Hippocrates
 > Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/
 > 
 > 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]