Browse code

allow case sensitivity to be toggled

Matthew Donoughe authored on 07/10/2009 at 20:01:52
Showing 2 changed files
... ...
@@ -14,7 +14,12 @@ compinit
14 14
 zmodload -i zsh/complist
15 15
 
16 16
 ## case-insensitive (all),partial-word and then substring completion
17
-zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
17
+if [ "$CASE_SENSITIVE" ]; then
18
+  zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
19
+  unset CASE_SENSITIVE
20
+else
21
+  zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
22
+fi
18 23
 
19 24
 zstyle ':completion:*' list-colors ''
20 25
 zstyle ':completion:*' hosts $( sed 's/[, ].*$//' $HOME/.ssh/known_hosts )
... ...
@@ -5,6 +5,9 @@ export ZSH=$HOME/.oh-my-zsh
5 5
 # Look in ~/.oh-my-zsh/themes/
6 6
 export ZSH_THEME="robbyrussell"
7 7
 
8
+# Set to this to use case-sensitive completion
9
+# export CASE_SENSITIVE="true"
10
+
8 11
 # Comment this out to disable weekly auto-update checks
9 12
 # export DISABLE_AUTO_UPDATE="false"
10 13