* question about keybinding
@ 2003-11-21 22:15 Andy Spiegl
2003-11-21 22:52 ` Oliver Kiddle
0 siblings, 1 reply; 4+ messages in thread
From: Andy Spiegl @ 2003-11-21 22:15 UTC (permalink / raw)
To: ZSH User List
Hi,
I'm basically using the emacs-keybinding and have my wordchars set to:
WORDCHARS='*?_-.[]~=/&;!%^(){}<>+'
But sometimes I'd like to behave emacs-(back|fore)ward-word differently
so that it doesn't jump over dots. Let's say when I additionally press
SHIFT together with meta-b. I've been pondering but I can't think
of a simple way to set it up so that the WORDCHARS setting changes
depending on which key I press.
Does any of you gurus have an idea?
Thanks so much,
Andy.
--
http://peru.spiegl.de Our project
http://radiomaranon.org.pe Radio Marañón, Jaén, Perú
o _ _ _
------- __o __o /\_ _ \\o (_)\__/o (_) -o)
----- _`\<,_ _`\<,_ _>(_) (_)/<_ \_| \ _|/' \/ /\\
---- (_)/ (_) (_)/ (_) (_) (_) (_) (_)' _\o_ _\_v
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
No matter how long or how hard you shop for an item,
after you've bought it, it will be on sale somewhere cheaper.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: question about keybinding
2003-11-21 22:15 question about keybinding Andy Spiegl
@ 2003-11-21 22:52 ` Oliver Kiddle
2003-11-22 1:05 ` Andy Spiegl
0 siblings, 1 reply; 4+ messages in thread
From: Oliver Kiddle @ 2003-11-21 22:52 UTC (permalink / raw)
To: Andy Spiegl; +Cc: ZSH User List
Andy Spiegl wrote:
>
> I'm basically using the emacs-keybinding and have my wordchars set to:
> WORDCHARS='*?_-.[]~=/&;!%^(){}<>+'
>
> But sometimes I'd like to behave emacs-(back|fore)ward-word differently
> so that it doesn't jump over dots. Let's say when I additionally press
> SHIFT together with meta-b. I've been pondering but I can't think
> of a simple way to set it up so that the WORDCHARS setting changes
> depending on which key I press.
Write a widget and change WORDCHARS within it. For example, I use:
tcsh-backward-word() {
local WORDCHARS="${WORDCHARS:s@/@}"
zle backward-word
}
zle -N tcsh-backward-word
Oliver
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: question about keybinding
2003-11-21 22:52 ` Oliver Kiddle
@ 2003-11-22 1:05 ` Andy Spiegl
2003-11-22 22:14 ` Oliver Kiddle
0 siblings, 1 reply; 4+ messages in thread
From: Andy Spiegl @ 2003-11-22 1:05 UTC (permalink / raw)
To: ZSH User List
> Write a widget and change WORDCHARS within it. For example, I use:
>
> tcsh-backward-word() {
> local WORDCHARS="${WORDCHARS:s@/@}"
> zle backward-word
> }
> zle -N tcsh-backward-word
Great!
BTW, there is no way to bind something to Meta+Shift+Backspace, no?
Thanks a lot, Oliver!
Andy.
--
http://peru.spiegl.de Our project
http://radiomaranon.org.pe Radio Marañón, Jaén, Perú
o _ _ _
------- __o __o /\_ _ \\o (_)\__/o (_) -o)
----- _`\<,_ _`\<,_ _>(_) (_)/<_ \_| \ _|/' \/ /\\
---- (_)/ (_) (_)/ (_) (_) (_) (_) (_)' _\o_ _\_v
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the Source, Luke!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: question about keybinding
2003-11-22 1:05 ` Andy Spiegl
@ 2003-11-22 22:14 ` Oliver Kiddle
0 siblings, 0 replies; 4+ messages in thread
From: Oliver Kiddle @ 2003-11-22 22:14 UTC (permalink / raw)
To: Andy Spiegl; +Cc: ZSH User List
Andy Spiegl wrote:
>
> BTW, there is no way to bind something to Meta+Shift+Backspace, no?
That's depends on your terminal emulator and not zsh. By using Ctrl-V
or cat -v or whatever, you can see what your terminal program sends for
a particular key. Chances are, it'll send nothing useful for
Meta-Shift-Backspace. You can use X key translation X resources to make
xterm produce your own escape sequence for a particular key combination,
though.
Oliver
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-11-22 22:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-21 22:15 question about keybinding Andy Spiegl
2003-11-21 22:52 ` Oliver Kiddle
2003-11-22 1:05 ` Andy Spiegl
2003-11-22 22:14 ` Oliver Kiddle
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).