summaryrefslogtreecommitdiff
path: root/dotfiles-darwin/zsh/rc
blob: bb9e027d9c92df7740d37f788cb809e8a7f4ee08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*- mode: shell-script -*-

autoload -Uz vault

alias df='df -Ph'
alias ls='ls -G'
alias pbclear='pbcopy </dev/null'
alias rsync='rsync --exclude=.DS_Store'

if (( ${+commands[gls]} )); then
  alias lsh='gls -Shrs'
else
  alias lsh='ls -Shlr | cut -f5- -w'
fi

# Prevent Apple Terminal from cluttering ${HOME}.
if [[ ${TERM_PROGRAM} == Apple_Terminal ]]; then
  SHELL_SESSIONS_DISABLE=1
fi

if [[ ${TERM_PROGRAM} != iTerm.app ]]; then
  autoload -Uz vcs_info

  zstyle ':vcs_info:*' enable git
  zstyle ':vcs_info:*' formats '[%b]'

  RPROMPT='${vcs_info_msg_0_}'
  precmd_functions+=(vcs_info)

  setopt PROMPT_SUBST
fi