]> git.rmz.io Git - dotfiles.git/commitdiff
zsh: "smartcase" completion
authorSamir Benmendil <me@rmz.io>
Fri, 4 Sep 2015 15:52:23 +0000 (16:52 +0100)
committerSamir Benmendil <me@rmz.io>
Fri, 4 Sep 2015 15:52:23 +0000 (16:52 +0100)
It's not quite smartcase as known from vim. It will respect all
typed uppercase letters but may accept uppercase matches on lowercase
letters.

zsh/lib/completion.zsh

index 5e852867f904872be9387a92d30f250adb639192..98abc2bd6a5b1e40aec97aedf9846a243be02de0 100644 (file)
@@ -8,14 +8,7 @@ WORDCHARS=''
 
 zmodload -i zsh/complist
 
-CASE_SENSITIVE='true'
-# case-(in)sensitive (all),partial-word and then substring completion
-if [ "x$CASE_SENSITIVE" = "xtrue" ]; then
-  zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
-  unset CASE_SENSITIVE
-else
-  zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
-fi
+zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
 
 zstyle ':completion:*' list-colors ''