The ',.' global abbreviation replacement feature is meant.
It is still on by default, but can be disabled by default by setting
$NOABBREVIATION to something greater than zero in .zshenv; or temporarily by
hitting '^xA', which switches it off (another '^xA' will reenable it - that
way, we can still get it back on, if disabled by $NOABBREVIATION).
Note: Turning off abbreviation effectively disables the feature. The binding
to ',.' still remains, though. Therefore, entering a comma (,) will
still take a few moments (because zsh is waiting for a possible ',.').
If you cannot be bothered to wait that long, quickly hit CTRL-V before
hitting the comma key.
I briefly looked for a better binding for the feature; but most (all?)
of the easy-to-remember ones (like ALT-a, ALT-, or ALT-.) where already
taken. Others didn't produce a useful character sequence on my keyboard
(like CTRL-, or CTRL.); and I don't want '^xA' for it, because that
takes four(!) key presses.
If someone has a better solution, please say so!
[ Frank Terbeck ]
* zshrc: Add persistent dirstack support for shells older than 4.2.0
+ * zshrc: Make ',.' abbreviation optional [Closes: issue445]
[ Michael Prokop ]
* zshrc:
- Support .deb in show-archive() [via harnir]
* zshenv: set $PATH on Solaris/SunOS.
- -- Michael Prokop <mika@grml.org> Sat, 17 May 2008 22:53:04 +0200
+ -- Frank Terbeck <ft@grml.org> Fri, 30 May 2008 14:56:45 +0200
grml-etc-core (0.3.50) unstable; urgency=low
# bindkey . rationalise-dot
# bindkey '\eq' push-line-or-edit
+
+## toggle the ,. abbreviation feature on/off
+# NOABBREVIATION: default abbreviation-state
+# 0 - enabled (default)
+# 1 - disabled
+NOABBREVIATION=${NOABBREVIATION:-0}
+
+grml_toggle_abbrev() {
+ if (( ${NOABBREVIATION} > 0 )) ; then
+ NOABBREVIATION=0
+ else
+ NOABBREVIATION=1
+ fi
+}
+
+zle -N grml_toggle_abbrev
+bindkey '^xA' grml_toggle_abbrev
+
# }}}
# a generic accept-line wrapper {{{
globalias() {
local MATCH
+
+ if (( NOABBREVIATION > 0 )) ; then
+ LBUFFER="${LBUFFER},."
+ return 0
+ fi
+
matched_chars='[.-|_a-zA-Z0-9]#'
LBUFFER=${LBUFFER%%(#m)[.-|_a-zA-Z0-9]#}
LBUFFER+=${abk[$MATCH]:-$MATCH}