Question

Problem: to navigate backwards with TAB in Zsh similarly as in Firefox by

Shift-TAB

Example of what Shift-TAB should do

I run the following code in terminal

ls <TAB>

I get

A B C D E F G H I J K H L M N...

I see the following in Zsh as I press TAB alt text http://dl.getdropbox.com/u/175564/smallEx.png

I navigate to the folder J by TAB. Then, I observe that I pressed once too often the tab key.

How can you make a backward TAB for Zsh similar as Firefox's Shift-TAB?

Was it helpful?

Solution

Try this:

bindkey '^[[Z' reverse-menu-complete

If this doesn't work, try running executing zsh like this (which does setopt MENU_COMPLETE):

zsh -Y

and then try again!

OTHER TIPS

This document should give you a good explanation:

In short, few terminals support a shifted Tab, but you might be able to get your terminal to support a "backtab" key sequence which you can configure X to send.

I'm not sure exactly what you require by a backward-tab, but zsh does have an undo zle widget which undoes the effect of the last pressed keystroke, be it Tab or anything else. Use it by binding it to a key:

$> bindkey "<Ctrl-V><Shift-Tab>" undo 

The means you press those key combos, don't type out the letters.

I think this is what you're asking for, but I can't tell for sure without more examples.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top