|
Server : Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 System : Linux server.jackjohnson.com 2.6.32-279.5.2.el6.x86_64 #1 SMP Fri Aug 24 01:07:11 UTC 2012 x86_64 User : jackjohn ( 502) PHP Version : 5.3.17 Disable Function : NONE Directory : /usr/share/zsh/4.3.10/functions/ |
Upload File : |
# Make hex integers appear as 0x...
setopt localoptions cbases
integer -g _insert_unicode_ready
if [[ $LASTWIDGET = insert-unicode-char && $_insert_unicode_ready -eq 1 ]]
then
# Second call; we should have a usable prefix.
# If we don't, give up.
(( ${+NUMERIC} )) || return 1
# Convert it back to hex, padded with zeroes to 8 digits plus the 0x...
local -i 16 -Z 10 arg=$NUMERIC
# ...and use print to turn this into a Unicode character.
LBUFFER+="$(print -n "\U${arg##0x}")"
_insert_unicode_ready=0
else
# Set the base to 16...
zle argument-base 16
# ...wait for user to type hex keys then call this widget again.
zle universal-argument
_insert_unicode_ready=1
fi