mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[zsh] fix the manpath-caused errors on shell startup once and for all
This commit is contained in:
parent
5e5eb4d39f
commit
1a1b27fa65
3 changed files with 10 additions and 5 deletions
|
@ -12,7 +12,7 @@ path_prepend() {
|
||||||
fi
|
fi
|
||||||
local var_name="$1"; shift
|
local var_name="$1"; shift
|
||||||
local value; for value in "$@"; do
|
local value; for value in "$@"; do
|
||||||
if eval "(( \${${var_name}[(ie)\$value]} > \${#${var_name}} ))"; then
|
if eval "(( \${${var_name}[(ie)\$value]-1} > \${#${var_name}} ))"; then
|
||||||
eval "${var_name}=(\"\$value\" \"\${${var_name}[@]}\")"
|
eval "${var_name}=(\"\$value\" \"\${${var_name}[@]}\")"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
@ -399,7 +399,7 @@ plugin() {
|
||||||
else
|
else
|
||||||
value="${plugin_dir}/${value}"
|
value="${plugin_dir}/${value}"
|
||||||
fi
|
fi
|
||||||
if eval "(( \${${var_name}[(ie)\$value]} > \${#${var_name}} ))"; then
|
if eval "(( \${${var_name}[(ie)\$value]-1} > \${#${var_name}} ))"; then
|
||||||
case "$operator" in
|
case "$operator" in
|
||||||
prepend) eval "$var_name=(\"\$value\" \${$var_name[@]})" ;;
|
prepend) eval "$var_name=(\"\$value\" \${$var_name[@]})" ;;
|
||||||
append) eval "$var_name=(\${$var_name[@]} \"\$value\")" ;;
|
append) eval "$var_name=(\${$var_name[@]} \"\$value\")" ;;
|
||||||
|
|
11
zsh/zshrc
11
zsh/zshrc
|
@ -46,15 +46,20 @@ _perf_timer_start "total"
|
||||||
fi
|
fi
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
# For some reason manpath is not always set when logging with ssh for instance.
|
||||||
|
# Let's ensure that it is always set and exported. The additional colon ensures
|
||||||
|
# that the system manpath isn't overwritten (see manpath(1)), though in reality
|
||||||
|
# two colons get added for some reason, which is also valid, but means
|
||||||
|
# something slightly different (again, see manpath(1)). Hope this won't cause
|
||||||
|
# any problems in the future.
|
||||||
|
export MANPATH="$MANPATH:"
|
||||||
|
|
||||||
for script in functions options path env plugins aliases completion zle prompt colorscheme; do
|
for script in functions options path env plugins aliases completion zle prompt colorscheme; do
|
||||||
_perf_timer_start "$script.zsh"
|
_perf_timer_start "$script.zsh"
|
||||||
source "$ZSH_DOTFILES/$script.zsh"
|
source "$ZSH_DOTFILES/$script.zsh"
|
||||||
_perf_timer_stop "$script.zsh"
|
_perf_timer_stop "$script.zsh"
|
||||||
done
|
done
|
||||||
|
|
||||||
# add colon after MANPATH so that it doesn't overwrite system MANPATH
|
|
||||||
MANPATH="$MANPATH:"
|
|
||||||
|
|
||||||
command_exists rbenv && eval "$(rbenv init -)"
|
command_exists rbenv && eval "$(rbenv init -)"
|
||||||
|
|
||||||
_perf_timer_stop "total"
|
_perf_timer_stop "total"
|
||||||
|
|
Loading…
Reference in a new issue