Skip to content

Instantly share code, notes, and snippets.

@smartwatermelon
Last active September 1, 2019 00:39
Show Gist options
  • Save smartwatermelon/25ce22ef18a7ce19e2c6da618bcf0de0 to your computer and use it in GitHub Desktop.
Save smartwatermelon/25ce22ef18a7ce19e2c6da618bcf0de0 to your computer and use it in GitHub Desktop.
My current .profile, annotated
## path
export PATH="/usr/local/opt/ruby/bin:$PATH"
## prompt
export PS1='\h:\W \u\$ '
## aliases
# /etc/sudoers.d/andrewrich: andrewrich ALL=(ALL) NOPASSWD: /sbin/ifconfig
alias bouncewifi='sudo ifconfig en0 down && sudo ifconfig en0 up && ifconfig en0'
alias brewup='/usr/local/etc/brewupdate.sh'
alias cat='/usr/local/bin/bat'
alias cv='command -v'
alias cvv='command -V'
alias edit='bbedit'
alias ls='ls -AFGhl'
alias own='sudo chown `whoami`'
alias ps='ps -efww'
# ytdl = "youtube download" -- get the audio track; good for e.g. music videos
alias ytdl='youtube-dl --restrict-filenames -x --audio-format m4a --embed-thumbnail'
# ytvpdl = "youtube video playlist download"
alias ytvpdl='youtube-dl --recode-video mkv --yes-playlist'
## functions
hgrep() { history | grep "$1" | grep -v "grep $1"; }
# gmv from GNU coreutils; "safe" rm moves to Trash instead of deleting
rm() { gmv -t ~/.Trash/ "$1"; }
## history
shopt -s histappend
shopt -s cmdhist
export HISTIGNORE="$HISTIGNORE:ls:fg:bg:fortune:history"
export HISTCONTROL="ignoreboth"
export HISTTIMEFORMAT="%F %T > "
export HISTSIZE=100000
export HISTFILESIZE=100000
# update ~/.bash_history after each command so it's current across windows/tabs
PROMPT_COMMAND='history -a'
## grep
export GREP_OPTIONS="--color=auto"
export GREP_COLOR="1;32"
alias grep="$( command -v grep ) ${GREP_OPTIONS}"
unset GREP_OPTIONS
## editor/pager
export EDITOR=vim
export VISUAL=vim
export PAGER=most
# bat doesn't like most as its pager, so override back to the default
export BAT_PAGER=less
## ruby
export LDFLAGS="-L/usr/local/opt/ruby/lib"
export CPPFLAGS="-I/usr/local/opt/ruby/include"
export PKG_CONFIG_PATH="/usr/local/opt/ruby/lib/pkgconfig"
## misc
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion
export HOMEBREW_GITHUB_API_TOKEN=_REDACTED_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment