Merge pull request #180 from saul365/master

lib/shopt: Add support for CASE_SENSITIVE
This commit is contained in:
Koichi Murase
2023-02-15 17:36:31 -08:00
committed by GitHub
2 changed files with 10 additions and 2 deletions

View File

@@ -27,7 +27,15 @@ shopt -s nocaseglob;
## SMARTER TAB-COMPLETION (Readline bindings) ##
# Perform file completion in a case insensitive fashion
bind "set completion-ignore-case on"
# Note: CASE_SENSITIVE is the compatibility name
if [[ ${OMB_CASE_SENSITIVE:-${CASE_SENSITIVE:-}} == false ]]; then
bind "set completion-ignore-case on"
elif [[ ${OMB_CASE_SENSITIVE:-${CASE_SENSITIVE:-}} == true ]]; then
bind "set completion-ignore-case off"
else
# By default, case sensitivity is disabled.
bind "set completion-ignore-case on"
fi
# Treat hyphens and underscores as equivalent
bind "set completion-map-case on"

View File

@@ -12,7 +12,7 @@ export OSH=~/.oh-my-bash
OSH_THEME="font"
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# OMB_CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.