cea6040c305d1e645f497e59133c2c5434a430ef
- Author
- Matthew Donoughe <mdonoughe@gmail.com>
- Committer
- Matthew Donoughe <mdonoughe@gmail.com>
- Date
Message
allow case sensitivity to be toggled
Diff
1diff --git a/lib/completion.zsh b/lib/completion.zsh
2index 795903d0dee5a4433955814241e6c8ae3845ae13..11f67249f66d62d85e9a96c640306a5a5db7cfd7 100644
3--- a/lib/completion.zsh
4+++ b/lib/completion.zsh
5@@ -14,7 +14,12 @@ compinit
6 zmodload -i zsh/complist
7
8 ## case-insensitive (all),partial-word and then substring completion
9-zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
10+if [ "$CASE_SENSITIVE" ]; then
11+ zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
12+ unset CASE_SENSITIVE
13+else
14+ zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
15+fi
16
17 zstyle ':completion:*' list-colors ''
18 zstyle ':completion:*' hosts $( sed 's/[, ].*$//' $HOME/.ssh/known_hosts )
19diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template
20index 787dc3d09fc6e1ab318cbf75991c5e77046393b3..7c43303bd375d293df12009ba1d861a0055f4c26 100644
21--- a/templates/zshrc.zsh-template
22+++ b/templates/zshrc.zsh-template
23@@ -5,6 +5,9 @@ export ZSH=$HOME/.oh-my-zsh
24 # Look in ~/.oh-my-zsh/themes/
25 export ZSH_THEME="robbyrussell"
26
27+# Set to this to use case-sensitive completion
28+# export CASE_SENSITIVE="true"
29+
30 # Comment this out to disable weekly auto-update checks
31 # export DISABLE_AUTO_UPDATE="false"
32