From 0d747a4a9de74312297b13c305c209ad613fa2fe Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Thu, 29 Oct 2020 01:17:35 +0800 Subject: [PATCH] [bugfix] virtualfish slow down fish dramatically --- fish/config/config.fish | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/fish/config/config.fish b/fish/config/config.fish index d42c2b3..0034327 100644 --- a/fish/config/config.fish +++ b/fish/config/config.fish @@ -1,5 +1,5 @@ #!/usr/bin/env fish -# + set -gx EDITOR nvim # enable fzf completion hotkey @@ -45,10 +45,6 @@ append-path-if-exists ~/.local/bin append-path-if-exists ~/.yarn/bin append-path-if-exists /snap/bin -# source virtualfish if available -if which pip &>/dev/null && pip show virtualfish &>/dev/null - eval (python -m virtualfish auto_activation) -end # datetime in filename format function dt @@ -113,16 +109,22 @@ if test -z "$STARTED" -a -z "$DISPLAY" -a -n "$XDG_VTNR" -a "$XDG_VTNR" -eq "1" startx end -alias k="kubectl" -alias kcc="k config get-contexts" -alias kcu="k config use-context" -alias kgd="k get deployment" -alias ked="k edit deployment" -alias kgp="k get pod -o 'custom-columns=NAME:.metadata.name,IMG:.spec.containers[*].image,STATUS:.status.phase'" -alias kl="k logs -f --all-containers" -alias issh='ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"' -alias iscp='scp -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"' +if status is-interactive + alias k="kubectl" + alias kcc="k config get-contexts" + alias kcu="k config use-context" + alias kgd="k get deployment" + alias ked="k edit deployment" + alias kgp="k get pod -o 'custom-columns=NAME:.metadata.name,IMG:.spec.containers[*].image,STATUS:.status.phase'" + alias kl="k logs -f --all-containers" + alias issh='ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"' + alias iscp='scp -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"' + set -q virtualfish || set -U virtualfish ( + which pip &>/dev/null && pip show virtualfish &>/dev/null && \ + python -m virtualfish auto_activation + ) + test -n $virtualfish && eval $virtualfish + cd $last_pwd + source-file-if-exists ~/.profile.fish +end -status is-interactive && cd $last_pwd - -source-file-if-exists ~/.profile.fish