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

Re: question about keybinding



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



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