mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-05-11 05:55:37 +00:00
lib/shopt: Allow CASE_SENSITIVE and HYPHEN_INSENSITIVE to work as documented
Adjusted shopt.sh to use CASE_SENSITIVE and HYPHEN_INSENSITIVE variables to affect completion. Note: this changes the old default hyphen insensitive completion behavior. The user will need to set HYPHEN_INSENSITIVE="true" to have the old default behavior.
This commit is contained in:
committed by
Koichi Murase
parent
c91a85d421
commit
d76bd709d0
@@ -43,10 +43,13 @@ if [[ ${OMB_CASE_SENSITIVE:-${CASE_SENSITIVE:-}} == true ]]; then
|
||||
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"
|
||||
# Treat hyphens and underscores as equivalent
|
||||
# CASE_SENSITIVE must be off
|
||||
if [[ ${OMB_HYPHEN_INSENSITIVE:-${HYPHEN_INSENSITIVE:-false}} == true ]]; then
|
||||
bind "set completion-map-case on"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Display matches for ambiguous patterns at first tab press
|
||||
bind "set show-all-if-ambiguous on"
|
||||
|
||||
@@ -16,7 +16,7 @@ OSH_THEME="font"
|
||||
|
||||
# Uncomment the following line to use hyphen-insensitive completion. Case
|
||||
# sensitive completion must be off. _ and - will be interchangeable.
|
||||
# HYPHEN_INSENSITIVE="true"
|
||||
# OMB_HYPHEN_INSENSITIVE="true"
|
||||
|
||||
# Uncomment the following line to disable bi-weekly auto-update checks.
|
||||
# DISABLE_AUTO_UPDATE="true"
|
||||
|
||||
Reference in New Issue
Block a user