]> git.donarmstrong.com Git - zsh.git/commitdiff
abbreviations are not preceeded by -
authorYaroslav Halchenko <debian@onerussian.com>
Tue, 18 Oct 2011 21:37:49 +0000 (17:37 -0400)
committermartin f. krafft <madduck@madduck.net>
Wed, 19 Oct 2011 06:19:59 +0000 (08:19 +0200)
Hi Martin,

please consider another 1 byte patch ;)  with recently added
abbreviations I found myself cursing too often while typing smth like
dpkg -L ...

so I augmented  magic-abbrev-expand to include "-" into the "last
word"... patch is attached

Cheers

--
Yaroslav O. Halchenko
Postdoctoral Fellow,   Department of Psychological and Brain Sciences
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834                       Fax: +1 (603) 646-1419
WWW:   http://www.linkedin.com/in/yarik

.zsh/zshrc/80_abbreviations

index e517d6cdd37b1188e55301b5c57a0ee6abf72b24..cae9274555ad28e864b69b896143b7babc5cace3 100644 (file)
@@ -18,7 +18,7 @@ abbreviations=(
 
 magic-abbrev-expand() {
     local MATCH
 
 magic-abbrev-expand() {
     local MATCH
-    LBUFFER=${LBUFFER%%(#m)[_a-zA-Z0-9]#}
+    LBUFFER=${LBUFFER%%(#m)[-_a-zA-Z0-9]#}
     LBUFFER+=${abbreviations[$MATCH]:-$MATCH}
     zle self-insert
 }
     LBUFFER+=${abbreviations[$MATCH]:-$MATCH}
     zle self-insert
 }