Skip to content

Instantly share code, notes, and snippets.

@philwhln
Last active September 26, 2018 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philwhln/5a2478d6ea66d1bcbeb8 to your computer and use it in GitHub Desktop.
Save philwhln/5a2478d6ea66d1bcbeb8 to your computer and use it in GitHub Desktop.
config.fish
set -x EDITOR vim
set -x PATH /usr/local/bin $PATH
set -x PATH /usr/local/sbin $PATH
set -x PATH /usr/local/opt/go/libexec/bin $PATH
set -x PATH $HOME/bin $PATH
set -x PATH $HOME/.rbenv/shims $PATH
rbenv rehash >/dev/null ^&1
set -x JAVA_HOME (/usr/libexec/java_home -v 1.8)
set -x PATH $PATH $JAVA_HOME/bin
set -x SBT_HOME /usr/local/opt/sbt@0.13
set -x PATH $PATH $SBT_HOME/bin
set -x PATH ./node_modules/.bin $PATH
set -x PATH $HOME/anaconda3/bin $PATH
# TODO: fix this
#. ~/anaconda3/etc/fish/conf.d/conda.fish
# psql
set -x PATH $PATH /Applications/Postgres.app/Contents/Versions/9.6/bin
set -x NVM_DIR $HOME/.nvm
#set -x PATH /usr/local/go/bin ~/go/bin $PATH
set -x GOPATH ~/go
set -x PATH $PATH $GOPATH/bin
set -x PATH $PATH ~/.cargo/bin
set -x PATH $PATH "/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
set -x HOMEBREW_NO_ANALYTICS 1
abbr s 'git status'
abbr b 'git branch'
abbr c 'git checkout'
abbr d 'git diff --color=always'
abbr f 'find . -name '
abbr l 'git log -n3'
abbr fxd 'git clean -fxd -e .vagrant'
abbr listeners 'lsof -iTCP -sTCP:LISTEN -P -n'
abbr t vagrant ssh -c \'bash --login -i -c py.test\'
abbr randpass openssl rand -base64 32
abbr csysdig 'docker run --rm -it --name sysdig --privileged -v /var/run/docker.sock:/host/var/run/docker.sock -v /dev:/host/dev -v /proc:/host/proc:ro -v /boot:/host/boot:ro -v /lib/modules:/host/lib/modules:ro -v /usr:/host/usr:ro sysdig/sysdig csysdig'
abbr vu 'vagrant up'
abbr vs 'vagrant ssh'
abbr vh 'vagrant halt'
abbr high 'vagrant ssh -c highstate'
abbr highstate 'vagrant ssh -c highstate'
abbr orch 'vagrant ssh -c "sudo salt-run state.orch orch.bootstrap-api"'
abbr eslint-vim "vim (eslint --config conf/eslint.json --format=compact . | grep ':' --color=never | cut -d':' -f1 | uniq)"
abbr master 'git checkout master ; and git pull ; and git fetch --all --tags; and git remote prune origin; and git branch --merged | egrep -v "(^\*|master)" | xargs git branch -d; and git status'
abbr opr "open 'https://github.com/BenchLabs/'(git remote -v | head -1 | cut -d'/' -f2 | cut -d'.' -f1)'/compare/master...'(git branch | grep '^\*' | cut -d' ' -f2)"
alias ap 'time pipenv run ansible-playbook'
abbr pipeline 'cd ~/src/bench/bench-pipeline'
abbr inf 'cd ~/src/bench/bench-infrastructure'
abbr ans 'cd ~/src/bench/bench-infrastructure/configuration'
abbr i 'idea .'
abbr k kubectl
abbr ks="kubectl config use-context kube0.staging.bench.co"
abbr kp="kubectl config use-context kube0.pro.bench.co"
abbr pods="kubectl get pods -o wide"
abbr p="kubectl get pods -o wide"
abbr ksp="kubectl get pods -n kube-system -o wide"
abbr lsp="kubectl logs -n kube-system"
abbr ke="kubectl exec -ti"
abbr nodes 'echo "MASTERS"; and kubectl get nodes --selector="kubernetes.io/role=master"; and echo "REGULAR NODES"; and kubectl get nodes --selector="kubernetes.io/role!=master,dedicated!=heavy"; and echo "HEAVY NODES"; and kubectl get nodes --selector="kubernetes.io/role!=master,dedicated=heavy"'
abbr services="kubectl get services"
abbr events="kubectl get events"
abbr t="terraform"
abbr tp="terraform plan"
abbr ti="terraform init"
abbr ta="terraform apply"
# Always grep with color
set -x GREP_OPTIONS '--color=always'
# GIT in prompt
set fish_git_dirty_color red
set fish_git_not_dirty_color green
function parse_git_branch
set -l branch (git branch 2> /dev/null | grep --color=never -e '\* ' | sed 's/^..\(.*\)/\1/')
set -l git_diff (git diff --name-only)
if test -n "$git_diff"
echo (set_color $fish_git_dirty_color)$branch(set_color normal)
else
echo (set_color $fish_git_not_dirty_color)$branch(set_color normal)
end
end
function fish_prompt
set -l git_dir (git rev-parse --git-dir 2> /dev/null)
if test -n "$git_dir"
printf '%s\n%s@%s %s%s%s%s> ' (parse_git_branch) (whoami) (hostname|cut -d . -f 1) (set_color $fish_color_cwd) (prompt_pwd) (set_color normal) (kubectl_status)
else
printf '%s@%s %s%s%s%s> ' (whoami) (hostname|cut -d . -f 1) (set_color $fish_color_cwd) (prompt_pwd) (set_color normal) (kubectl_status)
end
end
test -e {$HOME}/.iterm2_shell_integration.fish ; and source {$HOME}/.iterm2_shell_integration.fish
set -g fish_user_paths "/usr/local/opt/curl/bin" $fish_user_paths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment