Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to make underlining of a command line disappear after an ordinary key press? (2)
- X-seq: zsh-users 14488
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: How to make underlining of a command line disappear after an ordinary key press? (2)
- Date: Tue, 13 Oct 2009 00:20:37 -0700
- In-reply-to: <119346.23104.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <119346.23104.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
On Oct 12, 1:46pm, Guido van Steen wrote:
}
} So, this would be the best way to rebind the space bar as well:
}
} """space-key-press(){
} if [[ $KEYS = " " ]]; then
} zle rebind-spacebar
} fi
} zle .self-insert
} }
}
} zle -N self-insert space-key-press
} """
You're making this WAY more difficult than it needs to be;
bindkey ' ' rebind-spacebar
should be quite sufficient.
You can't rename a single widget to multiple things, so if you use
"zle -N self-insert space-key-press" then you cannot also use
"zle -N self-insert ordinary-key-press".
Generally speaking you use "zle -N" when you want to replace the behavior
of a widget no matter what key is used to invoke it, and you use bindkey
when you want to change the behavior of a specific key.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author