Skip to content

Command line aliases

Sara Gaudon edited this page Nov 12, 2019 · 1 revision

KoNote Aliases

Add any of the below to your ~./.zshrc or ~/.bashrc file:

# Keeps app persistently open, re-opens after close. Opens remote debugging.
alias ns='while true; do npm start; done;'

# Remove all locks from default data directory
alias ul='setopt localoptions; rm -rf data/_locks/*'

# Combination of unlock and persistent open
alias nss='setopt localoptions rmstarsilent; while true; do rm -rf data/_locks/*; npm start; done'

# Nukes default data folder
alias nuke='rm -rf data'

# CD's to the path of the current most forward-facing Finder window
cdf() {
	target=`osascript -e 'tell application "Finder" to if (count of Finder windows) > 0 then get POSIX path of (target of front Finder window as text)'`
	if [ "$target" != "" ]; then
		cd "$target"; pwd
	else
		echo 'No Finder window found' >&2
	fi
}

Github Aliases

Replace/add to aliases in ./gitconfig

[alias]
  s = status
  a = add
  ap = add --patch
  d = diff
  dc = diff --cached
  cm = commit
  plr = pull --rebase
  l = log --graph --date-order --pretty=format:'%C(bold red)%h%Creset -%C(bold yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'
  la = log --all --graph --date-order --pretty=format:'%C(bold red)%h%Creset -%C(bold yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'
  rb = rebase
  co = checkout
  subup = submodule update --init --recursive
  b = branch
  dv = checkout develop
  sub = submodule
  m = merge --no-ff
  mff = merge
  cma = commit --amend
  rs = reset
  rsh = reset --hard
  ba = branch -a
  st = stash
  rbi = rebase -i
  stl = stash list
  gerp = grep
  f = fetch
  cp = cherry-pick
  fp = fetch --prune
  ld = log --graph --date-order --pretty=format:'%C(bold red)%h%Creset -%C(bold yellow)%d%Creset %s %Cgreen(%cd) %C(bold blue)<%an>%Creset'
  lda = log --all --graph --date-order --pretty=format:'%C(bold red)%h%Creset -%C(bold yellow)%d%Creset %s %Cgreen(%cd) %C(bold blue)<%an>%Creset'

Clone this wiki locally