aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2023-01-01 14:59:21 +0800
committerGuangxiong Lin <[email protected]>2023-01-01 14:59:21 +0800
commit93f2df7d28a177872db1ca0815a3d1bc99295cf1 (patch)
tree1dbe8db3c10361fffde1b93f7fca5faae35a015e
parent5427e16b22973f17269c23ffaad539fc1c49d9e0 (diff)
downloaddotfiles-93f2df7d28a177872db1ca0815a3d1bc99295cf1.tar.gz
dotfiles-93f2df7d28a177872db1ca0815a3d1bc99295cf1.tar.bz2
dotfiles-93f2df7d28a177872db1ca0815a3d1bc99295cf1.zip
Update config of z.sh
-rwxr-xr-x.zrc7
-rw-r--r--.zshrc8
2 files changed, 7 insertions, 8 deletions
diff --git a/.zrc b/.zrc
index 6b289fa..5856f5c 100755
--- a/.zrc
+++ b/.zrc
@@ -1,8 +1,9 @@
#!/usr/bin/env bash
-if [ ! -f /usr/share/z/z.sh -a ! -f /usr/local/etc/profile.d/z.sh ]; then
- return
-fi
+[[ -r /usr/share/z/z.sh ]] && source /usr/share/z/z.sh
+[[ -r /usr/local/etc/profile.d/z.sh ]] && source /usr/local/etc/profile.d/z.sh
+
+[ ! -f /usr/share/z/z.sh -a ! -f /usr/local/etc/profile.d/z.sh ] && return
if command -v fzf &> /dev/null; then
unalias j 2> /dev/null
diff --git a/.zshrc b/.zshrc
index 930ca76..3efa128 100644
--- a/.zshrc
+++ b/.zshrc
@@ -22,18 +22,16 @@ source $HOME/.path
source $HOME/.env
source $HOME/.aliases
source $HOME/.functions
-source $HOME/.zrc
-
-[[ -r /usr/share/z/z.sh ]] && source /usr/share/z/z.sh
-[[ -r /usr/local/etc/profile.d/z.sh ]] && source /usr/local/etc/profile.d/z.sh
+[ -r "$HOME/.zrc" ] && source "$HOME/.zrc"
[ -r $HOME/.zplugrc ] && source $HOME/.zplugrc
[ -r $HOME/.nnnrc ] && source $HOME/.nnnrc
[ -r $HOME/.fzfrc ] && source $HOME/.fzfrc
[[ $(uname) == Darwin ]] && [ -r $HOME/.macos ] && source $HOME/.macos
-[ -r $HOME/.zsh_local ] && source $HOME/.zsh_local
if command -v direnv &> /dev/null; then
eval "$(direnv hook zsh)"
fi
+
+[ -r $HOME/.zsh_local ] && source $HOME/.zsh_local