Silence compinit when it finds shared Homebrew stuff
This commit is contained in:
parent
6f4227376c
commit
0b9c6abef6
1 changed files with 14 additions and 1 deletions
15
zshrc
15
zshrc
|
|
@ -290,8 +290,21 @@ bindkey -e # emacs style key bindings
|
||||||
|
|
||||||
# 10. Completion
|
# 10. Completion
|
||||||
# =============
|
# =============
|
||||||
|
|
||||||
autoload -Uz compinit
|
autoload -Uz compinit
|
||||||
compinit
|
|
||||||
|
# Sharing Homebrew in /usr/local with multiple users on the same machine means
|
||||||
|
# that group writable files in /usr/local are deemed insecure. But I'm the only
|
||||||
|
# actual user so tell compinit not to bother me about compaudit's complaints.
|
||||||
|
is_group_writable() {
|
||||||
|
local ls=$(ls -ld "$1")
|
||||||
|
[[ "${ls:5:1}" = "w" ]]
|
||||||
|
}
|
||||||
|
if mac && is_group_writable /usr/local/share; then
|
||||||
|
compinit -u
|
||||||
|
else
|
||||||
|
compinit
|
||||||
|
fi
|
||||||
|
|
||||||
# 11. SSH Keychain
|
# 11. SSH Keychain
|
||||||
# ================
|
# ================
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue