44
55HISTSIZE=5000
66SAVEHIST=5000
7- HISTFILE=~ /.zsh_history
7+ HISTFILE=$HOME /.zsh_history
88setopt append_history
99setopt extended_history
1010setopt share_history
@@ -49,10 +49,10 @@ on_second_prompt() {
4949 if [[ " $prompt_run_count " != 1 ]]; then
5050 (( prompt_run_count = prompt_run_count + 1 ))
5151 else
52- # zmodload zsh/zprof
52+ # zmodload zsh/zprof
5353 load_slower
5454 load_slowest
55- # zprof
55+ # zprof
5656 precmd_functions_remove=( on_second_prompt )
5757 precmd_functions=( ${precmd_functions: |precmd_functions_remove} )
5858 fi
@@ -89,7 +89,7 @@ setup_pyenv() {
8989 compinit
9090 unfunction -m pyenv python python3 pip pip3
9191 if ! command -v pyenv > /dev/null; then
92- export PATH=" $PYENV_ROOT /bin:$PATH "
92+ export PATH=" $PYENV_ROOT /bin:$PATH "
9393 if [[ -n " $_OLD_VIRTUAL_PATH " ]]; then
9494 export _OLD_VIRTUAL_PATH=" $PYENV_ROOT /bin:$_OLD_VIRTUAL_PATH "
9595 fi
@@ -207,7 +207,7 @@ setup_flutter() {
207207 export PATH=" $HOME /flutter/bin:$HOME /.pub-cache/bin:$PATH "
208208 if [[ -f /usr/sbin/flatpak ]]; then
209209 if ! which google-chrome > /dev/null 2> /dev/null; then
210- flatpak_exports=" /var/lib/flatpak/exports" # "$(flatpak --installations)/exports"
210+ flatpak_exports=" /var/lib/flatpak/exports" # "$(flatpak --installations)/exports"
211211 export CHROME_EXECUTABLE=" $flatpak_exports /bin/com.google.Chrome"
212212 fi
213213 fi
@@ -320,14 +320,20 @@ setup_completion_more() {
320320
321321 setup_completion_kubectl () {
322322 if which kubectl > /dev/null 2> /dev/null; then
323- source <( kubectl completion zsh)
323+ if ! [[ -f " $HOME /.cache/_kubectl" ]]; then
324+ kubectl completion zsh > " $HOME /.cache/_kubectl"
325+ fi
326+ source " $HOME /.cache/_kubectl"
324327 fi
325328 }
326329 setup_completion_kubectl
327330
328331 setup_completion_pipenv () {
329332 if which pipenv > /dev/null 2> /dev/null; then
330- eval " $( _PIPENV_COMPLETE=zsh_source pipenv) "
333+ if ! [[ -f " $HOME /.cache/pipenv/_pipenv" ]]; then
334+ _PIPENV_COMPLETE=zsh_source pipenv > " $HOME /.cache/pipenv/_pipenv"
335+ fi
336+ source " $HOME /.cache/pipenv/_pipenv"
331337 fi
332338 }
333339 setup_completion_pipenv
394400
395401# theme
396402
397- [[ -f ~ /.zshrc-theme ]] && eval " $( cat ~ /.zshrc-theme) "
403+ [[ -f " $HOME /.zshrc-theme" ]] && eval " $( cat " $HOME /.zshrc-theme" ) "
398404
399405# prompt
400406
@@ -673,7 +679,7 @@ function theme {
673679 iterm_profile=Light
674680 term_theme=${term_variation} light
675681 export LIGHT=true
676- echo " export LIGHT=true" > ~ /.zshrc-theme
682+ echo " export LIGHT=true" > " $HOME /.zshrc-theme"
677683 gnome_theme=Adwaita
678684 gnome_color_scheme=prefer-light
679685 macos_theme=false
@@ -682,7 +688,7 @@ function theme {
682688 iterm_profile=Default
683689 term_theme=${term_variation} dark
684690 export LIGHT=false
685- echo " export LIGHT=false" > ~ /.zshrc-theme
691+ echo " export LIGHT=false" > " $HOME /.zshrc-theme"
686692 gnome_theme=Adwaita-dark
687693 gnome_color_scheme=prefer-dark
688694 macos_theme=true
@@ -692,15 +698,15 @@ function theme {
692698 echo -e " \033]50;SetProfile=$ITERM_PROFILE \a"
693699 fi
694700 if [[ " $TERM " == " xterm-kitty" ]]; then
695- kitty @ set-colors -c -a ~ /.config/kitty/colorscheme.$term_theme .conf
701+ kitty @ set-colors -c -a " $HOME /.config/kitty/colorscheme.$term_theme .conf"
696702 kitty @ env LIGHT=$LIGHT
697703 fi
698704 if [[ " $TERM " == " foot-extra" ]]; then
699705
700706 fi
701707 if [[ -z " $SSH_CLIENT " ]]; then
702- ln -sf foot.$term_theme .ini ~ /.config/foot/foot.ini
703- ln -sf colorscheme.$term_theme .conf ~ /.config/kitty/colorscheme.conf
708+ ln -sf foot.$term_theme .ini " $HOME /.config/foot/foot.ini"
709+ ln -sf colorscheme.$term_theme .conf " $HOME /.config/kitty/colorscheme.conf"
704710 fi
705711 setup_prompt
706712 if [[ -z " $SSH_CLIENT " ]]; then
0 commit comments