- configuration file for the bash shell
- gets loaded when you load up the shell (open the terminal)
- actual file depends on which shell you're using
.bash_profile
and.bashrc
if you're using bash.zshrc
if you're using zsh
- check which shell you're in by running
echo $SHELL
in terminal
export PS1="Live long and prosper 🖖 "
- Bash syntax: https://ss64.com/bash/syntax-prompt.html
- Zsh syntax: http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Prompt-Expansion
# GIT
alias gs="git status"
alias gd="git diff"
alias gde="git diff --ignore-all-space --ignore-space-at-eol --ignore-space-change --ignore-blank-lines -- . ':(exclude)*package-lock.json'"
alias ga="git add"
alias ga.="git add ."
alias gc="git commit"
alias gcm="git commit -m"
alias gb="git branch"
alias gcb="git checkout -b"
alias gch="git checkout"
alias gp="git push"
alias gm="git merge"
alias gl="git log"
# OTHER
alias hidedesktop="defaults write com.apple.finder CreateDesktop false && killall Finder"
alias showdesktop="defaults write com.apple.finder CreateDesktop true && killall Finder"
alias coderacademy="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome https://coderacademy.instructure.com/courses/271/ https://mail.google.com/mail/u/1/#inbox https://calendar.google.com/calendar/b/1/r?tab=mc --new-window"
alias serve="python -m SimpleHTTPServer"
alias py="python3"
# add commit and push vimwiki from anywhere
alias vp="cd ~/vimwiki && git add . && git commit -m 'autosave' && git push && cd -"
# pull vimwiki from anywhere
alias vpl='cd ~/vimwiki && git pull && cd -'
# generic autosave
alias autosave="git add . && git commit -m 'autosave' && git push"
# do something different depending on OS (in this case, different colours when ls)
case $os in
"Darwin" )
alias ls='ls -GFh';;
"Linux" )
alias ls='ls --color=auto';;
esac