summary refs log tree commit diff
path: root/.zshrc
blob: b257d9faeb0f8e6ab126ae96cd08ae3af76bc21a (plain) (blame)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
unsetopt beep
setopt nomatch interactive_comments
HISTFILE=~/.history
HISTSIZE=SAVEHIST=5000
setopt inc_append_history hist_ignore_dups

autoload -Uz compinit && compinit
autoload -Uz colors && colors

bindkey -v
KEYTIMEOUT=1

PATH=$PATH:~/.bin
export PAGER=less MANPAGER=less EDITOR=vim GIT_EDITOR=vim
type nvim > /dev/null &&
  MANPAGER=manpager EDITOR=nvim GIT_EDITOR=nvim && alias vim=nvim
export GPG_TTY=$TTY

export CLICOLOR=1
[[ "$OSTYPE" = 'linux-gnu' ]] &&
  alias ls='ls --color' grep='grep --color' rm='rm -I'

alias gs='git status -sb'
alias ga='git add'
alias gc='git commit'
alias gca='git commit --amend'
alias gmv='git mv'
alias grm='git rm'
alias gst='git stash'
alias gt='git tag'
alias gsh='git show'
alias gco='git checkout'
alias gb='git branch'
alias gm='git merge'
alias gp='git push'
alias gf='git fetch'
alias gu='git pull'
alias gr='git rebase'
alias grc='git rebase --continue'
alias grs='git rebase --skip'
alias gra='git rebase --abort'
alias gd='git diff'
alias gl='git log --graph --pretty=log'

setopt prompt_subst
[[ -n "$SSH_CLIENT" ]] && _prompt_ssh='%F{magenta}'
_prompt_git() {
  local dotgit=.git head
  [[ -d "$dotgit" ]] || dotgit=../.git
  [[ -d "$dotgit" ]] || return 0
  read head < "$dotgit/HEAD"
  case "$head" in
    ref:*) echo ":${head#*/*/}";;
    *) echo ":${head:0:7}";;
  esac
}
PROMPT="%(?.%F{green}$_prompt_ssh.%F{red})»%f "
RPROMPT='%F{blue}%50<…<%~%F{yellow}$(_prompt_git)%f'

typeset -ga preexec_functions precmd_functions

_n() { _n() { echo } }
precmd_functions+=(_n)

_title() { print -Pn "\e]0;$@\a" }
_title_precmd() { _title "%1~" }
_title_preexec() { _title "%1~: $1" }
precmd_functions+=(_title_precmd)
preexec_functions+=(_title_preexec)

[[ -f ~/.nvm/nvm.sh ]] && source ~/.nvm/nvm.sh
if [[ -d /usr/local/share/chruby ]]; then
  source /usr/local/share/chruby/chruby.sh
  chruby ruby
fi

true
2018-09-13Never send PRIVMSG to TagStatus or TagVerboseJune McEnroe 2018-09-13Move color selection to format.cJune McEnroe 2018-09-13Fix len for format->split at end of stringJune McEnroe 2018-09-13Avoid uninitialized x in uiReadJune McEnroe 2018-09-13Add IRCDefault to colors enumJune McEnroe 2018-09-13Return a format->split even at the end of the stringJune McEnroe 2018-09-13Fix weird tab-complete after commaJune McEnroe 2018-09-13Rewrite UI againJune McEnroe 2018-09-12Add note about C-oJune McEnroe 2018-09-12Use formatParse split to position input cursorJune McEnroe 2018-09-12Factor out IRC formatting parsingJune McEnroe 2018-09-11Add /help equivalent to /manJune McEnroe 2018-09-11Don't render every PM as a pingJune McEnroe 2018-09-11Add urlOpenMatchJune McEnroe 2018-09-10Depend on man.sh for chroot.tar targetJune McEnroe 2018-09-10Set LESSSECURE=1 in man.shJune McEnroe 2018-09-10Add /man commandJune McEnroe 2018-09-10Install man page in chrootJune McEnroe 2018-09-10Install man pageJune McEnroe 2018-09-10Split keys into subsections and document colorsJune McEnroe 2018-09-10Add "blank" lines to chatte.1June McEnroe 2018-09-10Document key bindings in chatte.1June McEnroe 2018-09-08Document slash commands in chatte.1June McEnroe