set -o vi tty=$(tty) export GPG_TTY=$tty # Path export PATH="/usr/local/bin:/usr/local/sbin:$PATH" export PATH="/usr/local/share/npm/bin:$PATH" export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" export PATH="/usr/local/opt/python/libexec/bin:$PATH" # Homebrew Python (typically 3) export PATH="$HOME/Library/Python/3.6/bin:$PATH" # Python 3 bin export PATH="$HOME/.local/bin:$PATH" # Stack (Haskell) puts stuff here export PATH="$HOME/.cabal/bin:$PATH" # Cabal (Haskell) puts stuff here ruby_prefix=$(brew --prefix ruby)/bin export PATH=$ruby_prefix/bin:$PATH # rubygems # Bash completion bash_completion=/usr/local/etc/profile.d/bash_completion.sh # shellcheck disable=1090 [[ -r $bash_completion ]] && . $bash_completion # Set the terminal into 256 color mode export TERM=xterm-256color # Shorten the pwd in the prompt to show only the n number of characters # NOTE: Bash 4+ only PROMPT_DIRTRIM=2 # Ascii color escape codes # Note that 256 color foreground codes follow the following format: # SAMPLE_256_COLOR="\[\e[38;05;255m\]" RED="\[\e[0;31m\]" YELLOW="\[\e[0;33m\]" CYAN="\[\e[0;36m\]" COLOR_NONE="\[\e[0m\]" # Show Git branch in prompt git_completion=/usr/local/etc/bash_completion.d/git-completion.bash if [ -f $git_completion ]; then export GIT_PS1_SHOWDIRTYSTATE=true export GIT_PS1_SHOWUNTRACKEDFILES=true export GIT_PS1_SHOWSTASHSTATE=true fi # Format the prompt function prompt_func() { # Show Git branch in prompt if [ -f $git_completion ]; then git_branch=$(__git_ps1 " (%s)") fi # Python: Show virtualenv in prompt if [ -z "$VIRTUAL_ENV" ]; then virtualenv="" else virtualenv="($(basename "$VIRTUAL_ENV")) " fi PS1="${YELLOW}${virtualenv}${CYAN}\h:${RED}\w${CYAN} \u${YELLOW}${git_branch}${RED} \$${COLOR_NONE} " } # Format the prompt PROMPT_COMMAND=prompt_func # Miscellaneous coloring and formatting export CLICOLOR=1 export LSCOLORS=dxfxcxdxbxegedabagacad alias ls='ls -h' # Go Stuff export GOPATH=$HOME/.go mkdir -p "$GOPATH/{src,bin}" export GOBIN=$GOPATH/bin env_gopath=$(go env GOPATH) export PATH=$PATH:/usr/local/opt/go/libexec/bin:$GOBIN:$env_gopath # Editors export EDITOR=vim # History Management shopt -s histappend export HISTCONTROL=ignoredups:erasedups export HISTSIZE=1000 # Keep TAR from tarring-up resource forks export COPYFILE_DISABLE=true # Miscellaneous aliases alias flushdns='sudo dscacheutil -flushcache && dscacheutil -flushcache' alias tree='tree -C' alias lock_pip='export PIP_REQUIRE_VIRTUALENV=true' alias unlock_pip='export PIP_REQUIRE_VIRTUALENV=false' alias delete_pyc='find . -name '\*.pyc' -delete' alias delete_orig='find . -name '\*.orig' -delete' alias install_kitty='curl -L https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin' # Helper vars export PEKKA='git+ssh://pekka.land/var/git' export MEOW='git@github.com:meowgorithm' export MAGIC='git@github.com:magicnumbers' export BIT='https://meowgorithm@bitbucket.org/meowgorithm' export GITLAB='git@gitlab.com:meowgorithm' export CHARM='git@github.com:charmbracelet' # Git export GOPRIVATE="github.com/charmbracelet" export GOPRIVATE="github.com/magicnumbers" # Print local network adapter IPs and copy them to the clipboard alias en0="ipconfig getifaddr en0 | pbcopy && ipconfig getifaddr en0" alias en1="ipconfig getifaddr en1 | pbcopy && ipconfig getifaddr en1" # Initialize Z # shellcheck source=/usr/local/etc/profile.d/z.sh [[ -f $(brew --prefix)/etc/profile.d/z.sh ]] && . "$(brew --prefix)/etc/profile.d/z.sh" # PIP + Virtualenv Stuff lazy_virtualenvwrapper_script=/usr/local/bin/virtualenvwrapper_lazy.sh if [ -f $lazy_virtualenvwrapper_script ]; then export PIP_REQUIRE_VIRTUALENV=true export PIP_RESPECT_VIRTUALENV=true export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python export PIP_LOG_FILE="$HOME/.cache/pip-log.txt" # Don't litter pip_log.txt in cwd please export WORKON_HOME=~/.virtualenvs # shellcheck disable=1090 source $lazy_virtualenvwrapper_script fi # Colored man pages export LESS_TERMCAP_mb=$'\E[01;31m' export LESS_TERMCAP_md=$'\E[01;31m' export LESS_TERMCAP_me=$'\E[0m' export LESS_TERMCAP_se=$'\E[0m' export LESS_TERMCAP_so=$'\E[01;44;33m' export LESS_TERMCAP_ue=$'\E[0m' export LESS_TERMCAP_us=$'\E[01;32m' # direnv # See: https://direnv.net if hash direnv 2>/dev/null; then eval "$(direnv hook bash)" fi # FZF export FZF_DEFAULT_OPTS='--margin=1,2,0,2 --height=20 --inline-info --border' # NPM # Make "global" installs local mkdir -p ~/.config/npm npm config set prefix "$HOME/.config/npm" export PATH=$HOME/.config/npm/bin:$PATH