bug-bash
[Top][All Lists]
Advanced

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

Please add these dynamic-complete-history / menu-complete bindings to ba


From: Jason A. Spiro
Subject: Please add these dynamic-complete-history / menu-complete bindings to bash/readline
Date: Tue, 30 Jun 2009 23:06:56 +0000

Hi,

Bash ships with lots of useful completion functions, but if you don't
bind them to keys, then less people will use them.

-  In bash's emacs keymap, please bind dynamic-complete-history to
M-/, since it's sort of like Emacs's dabbrev-expand -- it looks
through the entire buffer (well, actually, the entire history) to
complete a word.

-  In bash's vi insert keymap, please bind dynamic-complete-history to
\C-x\C-i -- this would give Bash a C-x C-i keystroke that works sort
of like Vim.  It's not a perfect match with what Vim does, but it's
the best available.

-  In bash/readline's vi insert keymap, please bind menu-complete to
\C-n.  This is like Vim's binding.
        bind -m vi-insert '"\C-n": menu-complete' ;

-  Bash/readline has no menu-complete-backward or
menu-complete-reverse function which could go on vi insert C-p like in
Vim.  The best Neil Moore <neil at s-z.org> could come up with is:
        bind -m vi-insert '"\C-n": menu-complete' ;
        bind -m vi-insert '"\C-b": universal-argument' ;
        bind -m vi-insert '"\C-p": "\C-b-1\C-n"'
   The problem is that, no matter whether you use Bash 3 or Bash 4,
C-p only works once.  If you press C-p twice, or C-p C-n, it thinks
you want to complete the next word.  This seems to be because
universal-argument exits the menu-complete in a way that
digit-argument does not.

P.S.  Neil, thank you -- most of the above is made up of some of your
thoughts, your text, and of your code that you told to me.  Only the
idea to ship them as bindings with Bash is mine.

--
Jason Spiro: software/web developer, packager, trainer, IT consultant.
I support Linux, UNIX, Windows, and more. Contact me to discuss your needs.
+1 (416) 992-3445 / www.jspiro.com




reply via email to

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