Last active
August 16, 2022 15:27
-
-
Save faceair/7d17cb42473c7543d325 to your computer and use it in GitHub Desktop.
My Fish Shell Config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
netstat -rn -f inet | grep 'utun3' | awk '{system("sudo route delete -net "$1" "$2)}' | |
netstat -rn -f inet | grep 'utun3' | awk '{system("sudo route delete -host "$1" "$2)}' | |
route -n add -net 172.0.0.0/8 -interface utun3 # dev 环境 | |
route -n add -host 47.96.11.196 -interface utun3 # gitlab.jiagouyun.com | |
route -n add -host 116.62.27.169 -interface utun3 # confluence.jiagouyun.com | |
route -n add -host 47.98.152.34 -interface utun3 # cmgmt.jiagouyun.com. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -gx __fish_config_dir $HOME/.config/fish | |
set -gx nvm_default_version lts | |
set -gx PKG_CONFIG_PATH /System/Library/Frameworks/Python.framework/Versions/2.7/lib/pkgconfig $PKG_CONFIG_PATH | |
set -gx GOPATH $HOME/.go:$HOME/Developer/Go | |
set -gx GOPRIVATE gitlab.jiagouyun.com | |
set -gx GOPROXY https://goproxy.cn,direct | |
set -gx PATH $HOME/.cargo/bin $HOME/.go/bin /opt/homebrew/bin /opt/homebrew/sbin /usr/local/bin $PATH | |
alias rm trash | |
alias del trash | |
alias gc "git clone" | |
alias reboot "sudo reboot" | |
alias cdp "cd ~/Developer" | |
alias cdg "cd ~/Developer/Go" | |
alias cdd "cd ~/Downloads" | |
alias vgot $__fish_config_dir/scripts/vgot | |
alias cleanroute $__fish_config_dir/scripts/cleanroute | |
alias fastme "set files /private/var/log/asl/*.asl; sudo rm -rf $files" | |
alias show "defaults write com.apple.finder AppleShowAllFiles YES; killall Finder" | |
alias hide "defaults write com.apple.finder AppleShowAllFiles NO; killall Finder" | |
alias livecode "rsync -rltvzO --exclude='/.git' --delete --filter=':- .gitignore'" | |
alias ksu 'kubectl config use-context' | |
alias kaf 'kubectl apply -n monitoring -f' | |
alias kak 'kubectl apply -n monitoring -k' | |
alias kget 'kubectl get -n monitoring -o wide' | |
alias klog 'kubectl logs -n monitoring -f' | |
alias kde 'kubectl describe -n monitoring' | |
alias krm 'kubectl delete -n monitoring' | |
alias kex 'kubectl exec -it -n monitoring' | |
alias pods 'watch -n 1 -c "kubectl get pods -n monitoring -o wide"' | |
set -U fish_greeting | |
function _auto_activate | |
if test "$VIRTUAL_ENV" != "" | |
if not string match (string trim --right --chars=ENV $VIRTUAL_ENV)'*' $PWD > /dev/null | |
if functions -q deactivate | |
deactivate | |
end | |
end | |
else if test -e $PWD/ENV/bin/activate.fish | |
source $PWD/ENV/bin/activate.fish | |
end | |
end | |
function _auto_activate_after_cd --on-event fish_postexec | |
if test (string sub --length 2 $argv) = "cd" | |
_auto_activate | |
end | |
end | |
if status is-interactive | |
_auto_activate | |
_nvm_update | |
nvm use $nvm_default_version >/dev/null | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ $# = 0 ]; then | |
echo 'usage: vgot cmdpackage[@version]' | |
exit 2 | |
fi | |
d=`mktemp -d` | |
cd "$d" | |
echo 'module temp' > go.mod | |
for i; do | |
pkg=`echo $i | sed 's/@.*//'` | |
go get "$i" && | |
go install "$pkg" && | |
echo installed `go list -f '{{.ImportPath}}@{{.Module.Version}}' "$pkg"` | |
done | |
rm -r "$d" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment