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

Re: How to make make shift tab == tab in BASH ??



Legend, Carl! That does the trick for me (both solutions work for me -
I've used the .bashrc line for a permanent setting)! I'm taking the
liberty of posting your reply to debian-user - I suspect there could be
others who would appreciate this pointer.

Thanks again
Zen

---
FYI, below...

On Tue, 2004-07-20 at 12:09, Zenaan Harkness wrote:
> Any answers to this one?
> 
> On Mon, 2004-07-12 at 12:35, Zenaan Harkness wrote:
> > Does anyone know how I can make SHIFT+TAB do the same thing in my bash
> > shell as TAB does (ie. tab-complete)?
> > 
> > The reason this would be very useful: Java naming conventions:
> > 
> > In Java, classes have each word capitalized. Eg:
> > MyFunctionalProceduralObjectBasedDoItAll.class
> > 
> > So, when I go to compile a java class, or similar, and I have similarly
> > named classes, I use tab-completion a lot. I type a few chars, hit tab,
> > then type the next char. That next char is often a capital letter, and I
> > often hit the TAB key before I've taken my little finger off the SHIFT
> > (for typing the next letter of the class I'm trying to compile).
> > 
> > This results in SHIFT+TAB and a terminal bell from bash, rather than
> > completion.
> > 
> > It would save me many many keystrokes a day if SHIFT-TAB effectively
> > sent a TAB when in bash.

On Tue, 2004-07-20 at 13:41, Carl Mummert wrote:

I assume you are having the problem under X-windows.

Try running:

  xmodmap -e 'keycode 0x17 =  Tab     Tab'

from a command prompt.

Then run an Xterm (not aterm, rxvt, etc.  Just xterm) and try it. On may
machine, shift-tab causes bash to complete in the xterm after running
.Xmodmap file.  

For some reason the shift-tab thing doesn't work in aterm. I can't tell
you why, but I'm sure it has to do with character translation.

If you do get it working, you may want to post a summary to debian-user
with your solution; this email didnt go to the list.

-- Carl


Addendum to previous message:

Read the bash manpage, especially the bind builtin and the complete
readline command.

In rxvt / aterm, add the following line to your .bachrc to make
shift-tab complete:

  bind '"\e[Z": complete'

I got the key sequence by typing 'cat > o'  then pressing shift-tab
once, then control-d, then 'od -ax o'

-- Carl



Reply to: