Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: How to trigger the death of zsh(3.0.5)



On Oct 8, 10:44pm, Mircea Damian wrote:
} Subject: Re: How to trigger the death of zsh(3.0.5)
}
} On Thu, Oct 08, 1998 at 11:58:31AM -0700, Bart Schaefer wrote:
} > That function is bound by default to ESC . and ESC _ in zsh.  Rebinding to
} > the bash equivalent is as easy as:
} > 
} > 	bindkey '\C\My' insert-last-word
} 
} Ok but how about the order? 
} ESC 1 ESC . will give the last argument when in bash it means the first
} one.

Ah.  There's really no way to fix that one.  Even in 3.1.4 where you can
make your own new zle functions, support for using the digit-argument
prefixes is not yet up to snuff.

You can do `ESC - ESC 1 ESC .' to negate the digit, in which case zsh
counts from the beginning.  You can even do `ESC - ESC 0 ESC .' to get
the command name.

Or you can do `! : x TAB' where x is the number of the word you want,
e.g. !:2 for the second word.

} Q: Is there a way to set the separator(or a list of separators) when
} doing backward-kill-word?

Yes, change the value of the WORDCHARS variable.  I use

	WORDCHARS='*?_-.[]~\!#$%^(){}<>'

The only drawback is that it also affects transpose-words, which is
sometimes not what you'd like.

On Oct 8, 10:49pm, Mircea Damian wrote:
} Subject: Re: How to trigger the death of zsh(3.0.5)
}
} What I meant is that if I press  \C\My I receive a
} beep instead of the last argument..

There are a couple of reasons why this might happen.  One is that if
you repeat insert-last-word without doing any other typing, it tries
to insert the last word from successively farther back in the history.
E.g.:

zsh[1] echo one two
one two
zsh[2] echo three four
three four
zsh[3] echo <ESC .>
zsh[3] echo four<ESC .>
zsh[3] echo two<ESC .>
(zsh beeps, ran out of history)
zsh[3] echo

More specifically than that, I can't tell.  If you type \Cv \C\My, what
do you see?  If you see ^Y, then your alt or meta key isn't working,
which could explain the beeping.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author