Skip to content

Shell config files

Course: 5 tools for senior engineers (Code without your mouse) - chapter 8

Shell config files let you run some code when the shell starts. You can use this to add aliases and functions

.bashrc or .zshrc

  1. aliases
  2. complex functions
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="robbyrussell"
source $ZSH/oh-my-zsh.sh
export NVM_DIR="/Users/harkiratsingh/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
export PATH="$PATH:/Users/harkiratsingh/nvim-macos/bin"
alias gc=git commit -m
alias gh git push origin HEAD
alias gs='git status'
alias gaa='git add --all'
alias gd='git diff'
alias .4='cd ../../../../'
alias .5='cd ../../../../..'
alias t=tmux
function hg() {
history | grep "$1";
}