浏览代码

Fix hyphen and underscore filename completion

This deletes the previous hack that allowed completing files with
the extension: e.g. `abcd.z` to `abcdefg.z`.

It is still possible to use `abcd[TAB].z`, and hyphens or underscores
are very much more important than this other trick.

Source:
https://github.com/robbyrussell/oh-my-zsh/issues/1398#issuecomment-169163149

Signed-off-by: Marc Cornellà <marc.cornella@live.com>
Gravemind 7 年之前
父节点
当前提交
0d897cca74
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      lib/completion.zsh

+ 3 - 3
lib/completion.zsh

@@ -12,14 +12,14 @@ zmodload -i zsh/complist
 
 ## case-insensitive (all),partial-word and then substring completion
 if [ "x$CASE_SENSITIVE" = "xtrue" ]; then
-  zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
+  zstyle ':completion:*' matcher-list 'r:|=*' 'l:|=* r:|=*'
   unset CASE_SENSITIVE
 else
   if [ "x$HYPHEN_INSENSITIVE" = "xtrue" ]; then
-    zstyle ':completion:*' matcher-list 'm:{a-zA-Z-_}={A-Za-z_-}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
+    zstyle ':completion:*' matcher-list 'm:{a-zA-Z-_}={A-Za-z_-}' 'r:|=*' 'l:|=* r:|=*'
     unset HYPHEN_INSENSITIVE
   else
-    zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
+    zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*'
   fi
 fi