Commit df8d184d authored by Robert Spencer's avatar Robert Spencer

Friendlier customization

Previously doing more than superficial changes would result in a dirty
working directory.

In addition some changes in your local configuration would not overrule
upstream configuration files.

This commit fixes both those issues.
parent 58086732
zshrc.local
cache
zshrc.local
......@@ -25,7 +25,7 @@
# Customizing
Customizing can be done by editing the .zsh/zshrc.local file.
Customizing can be done by adding files to ~/.zsh/zshrc_local.d/ directory and editing the ~/.zsh/zshrc.local file.
If you have something awesome to contribute, please consider adding it to zshrc.d/.
......
# Ignore everything in this directory
*
# Except this file
!.gitignore
......@@ -20,10 +20,10 @@ fi
if [ ! -e ~/.zsh/zshrc.d/51-completion-awit-ssh.zsh ]; then
# Install
ln -s ~/.zsh/contrib/awit-ssh-completion/51-completion-awit-ssh.zsh ~/.zsh/zshrc.d/
ln -s ~/.zsh/contrib/awit-ssh-completion/51-completion-awit-ssh.zsh ~/.zsh/zshrc_local.d/
echo "Installed ~/.zsh/zshrc.d/51-completion-awit-ssh.zsh"
else
# Uninstall
rm -f ~/.zsh/zshrc.d/51-completion-awit-ssh.zsh
echo "Uninstalled ~/.zsh/zshrc.d/51-completion-awit-ssh.zsh"
rm -f ~/.zsh/zshrc.d/51-completion-awit-ssh.zsh ~/.zsh/zshrc_local.d/51-completion-awit-ssh.zsh
echo "Uninstalled ~/.zsh/zshrc.d/51-completion-awit-ssh.zsh and ~/.zsh/zshrc_local.d/51-completion-awit-ssh.zsh"
fi
# https://github.com/robbyrussell/oh-my-zsh/wiki/Customization#overriding-internals
*.zsh
# https://github.com/robbyrussell/oh-my-zsh/wiki/Customization#overriding-internals
*.zsh
# https://github.com/robbyrussell/oh-my-zsh/wiki/Customization#overriding-and-adding-plugins
#
# Ignore everything in this directory
*
# Except this file
!.gitignore
# https://github.com/robbyrussell/oh-my-zsh/wiki/Customization#overriding-and-adding-themes
#
# Ignore everything in this directory
*
# Except this file
!.gitignore
......@@ -2,10 +2,24 @@
setopt EXTENDED_GLOB
# Source in resources
for F in ~/.zsh/zshrc.d/([a-zA-Z0-9-]##).zsh; do
source $F
find ~/.zsh/zshrc{,_local}.d/([a-zA-Z0-9-]##).zsh | sort -t/ -k6,6 | while read LINE; do
DIR="${LINE%/*}"
FILE="${LINE##*/}"
# If there's a file in zshrc_local.d with the same name as one
# in zshrc.d, ignore the file in zshrc.d
if [[ "$DIR" =~ "zshrc.d" ]] && [ -e "~/.zsh/zshrc_local.d/$FILE" ]; then
# Do nothing
:
else
source "$LINE"
fi
done
# NB: Note that precedence matters, so some settings will not yield the
# expected results when put into ~/.zsh/zshrc.local. In that case you need
# to figure out the file number and put it into ~/.zsh/zshrc_local.d/
# Source in local stuff
if [ -f ~/.zsh/zshrc.local ]
then
......
# Ignore everything in this directory
*
# Except this file
!.gitignore
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment