summary refs log tree commit diff
path: root/home/.zshrc
blob: 77e4569db3658e907d8f4b93e0acfa62fc88da68 (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
unsetopt beep
setopt nomatch interactive_comments
setopt inc_append_history hist_ignore_dups
HISTFILE=~/.history HISTSIZE=5000 SAVEHIST=5000

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

bindkey -v
KEYTIMEOUT=1

OLDPATH=$PATH
path=(
  /sbin /bin
  /usr/local/sbin /usr/local/bin
  /usr/sbin /usr/bin
  ~/.bin ~/.cargo/bin
)

export PAGER=less MANPAGER=less EDITOR=vim GIT_EDITOR=vim
type nvim > /dev/null \
  && EDITOR=nvim GIT_EDITOR=nvim MANPAGER="nvim -c 'set ft=man' -" \
  && alias vim=nvim
export GPG_TTY=$TTY

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

export NETHACKOPTIONS='name:June, role:Valkyrie, race:Human, gender:female,
  align:neutral, dogname:Moro, catname:Baron, pickup_types:$!?+/=, color,
  DECgraphics'

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

nasd() {
  local tmp=$(mktemp)
  cat > $tmp
  nasm -p =(echo 'bits 64') -o >(ndisasm -b 64 /dev/stdin) $tmp
  rm $tmp
}

setopt prompt_subst
_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
}
[ -n "$SSH_CLIENT" ] && _prompt_ssh='%F{magenta}'
PROMPT="%(?.%F{green}$_prompt_ssh.%F{red})»%f "
RPROMPT='%F{blue}%50<…<%~%F{yellow}$(_prompt_git)%f'

_n() { _n() { echo } }
_title() { print -Pn "\e]0;$1\a" }
_title_precmd() { _title '%1~' }
_title_preexec() { psvar=("$1") _title '%1~: %1v' }
precmd_functions=(_n _title_precmd)
preexec_functions=(_title_preexec)
odesJohn Keeping 2015-08-14patch: use cgit_print_error_page() for HTTP status codesJohn Keeping 2015-08-14blob: use cgit_print_error_page() to add HTTP headersJohn Keeping 2015-08-14snapshot: use cgit_print_error_page() instead of html_status()John Keeping 2015-08-14plain: use cgit_print_error_page() instead of html_status()John Keeping 2015-08-14clone: use cgit_print_error_page() instead of html_status()John Keeping 2015-08-14cgit: use cgit_print_error_page() where appropriateJohn Keeping 2015-08-14ui-shared: add cgit_print_error_page() functionJohn Keeping 2015-08-14ui-patch: make sure to send http headersChristian Hesse 2015-08-13Makefile: make "git/config.mak.uname" inclusion optionalJohn Keeping 2015-08-13ui-shared: show full date in tooltip if longer ago than max_relativeJohn Keeping 2015-08-13ui-shared: use common function in print_rel_date()John Keeping 2015-08-13ui-shared: extract date formatting to a functionJohn Keeping 2015-08-13filter: don't use dlsym unnecessarilyJohn Keeping 2015-08-13ui-tree: use "sane" isgraph()John Keeping 2015-08-13cgit.h: move stdbool.h from ui-shared.hJohn Keeping 2015-08-13cache.c: fix header orderJohn Keeping 2015-08-13configfile.c: don't include system headers directlyJohn Keeping 2015-08-13Remove redundant includesJohn Keeping 2015-08-13Makefile: include Git's config.mak.unameJohn Keeping 2015-08-13tests: allow shell to be overriddenJohn Keeping 2015-08-13redirect: cleanlinessJason A. Donenfeld 2015-08-13redirect: be more careful for different cgi setupsJason A. Donenfeld 2015-08-12ui-log: fix double countingJohn Keeping 2015-08-12log: allow users to follow a fileJohn Keeping 2015-08-12shared: make cgit_diff_tree_cb publicJohn Keeping 2015-08-12t0110: Chain together using &&Jason A. Donenfeld 2015-08-12about: always ensure page has a trailing slashJason A. Donenfeld 2015-08-12filters: apply HTML escapingLazaros Koromilas 2015-08-12git: update to v2.5.0Christian Hesse 2015-08-12Fix processing of repo.hide and repo.ignoreDaniel Reichelt