summary refs log tree commit diff
path: root/home/.zshrc
blob: 3c1f51dcb0175daee6ee99eecf810dcc63bd595e (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
unsetopt beep
setopt auto_pushd 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=({,/usr/local,/usr,~/.local}/{s,}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 ll='ls -lh'
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{white}$_prompt_ssh.%F{red})%#%f "
RPROMPT='%F{white}%50<..<%~$(_prompt_git)%f'

_title() { }
[[ "$TERM" =~ "xterm" ]] && _title() { print -Pn "\e]0;$1\a" }
_title_precmd() { _title '%1~' }
_title_preexec() { psvar=("$1") _title '%1~: %1v' }
precmd_functions=(_title_precmd)
preexec_functions=(_title_preexec)
ee00212a20cb33b8f660ae73ecd5b95a&follow=1'>Move to www/text.causal.agencyJune McEnroe 2019-07-12Add new causal.agency with shotty shotsJune McEnroe 2019-07-12Use -s to infer terminal sizeJune McEnroe 2019-07-12Add DCH to shottyJune McEnroe 2019-07-12Support insert mode in shottyJune McEnroe 2019-07-11Don't do carriage return on line feedJune McEnroe 2019-07-11Interpret 256color-style SGRsJune McEnroe 2019-07-11Use inline style rather than <b>, <i>, <u>June McEnroe 2019-07-11Factor out clearJune McEnroe 2019-07-11Add bright option to shottyJune McEnroe 2019-07-11Output <b>, <i>, <u> in shottyJune McEnroe 2019-07-10Ignore SM and RMJune McEnroe 2019-07-09Add shotty man page and build itJune McEnroe 2019-07-09Add up -cJune McEnroe 2019-07-09Add options for default colors to shottyJune McEnroe 2019-07-08Use char literals consistentlyJune McEnroetd colspan='3' class='logmsg'> 2021-01-12Consolidate hilex formatters into hilex.cJune McEnroe 2021-01-12Remove hacky tagging from hilexJune McEnroe God that makes the lexers so much simpler. 2021-01-12Add htagml -iJune McEnroe 2021-01-12Render tag index in HTMLJune McEnroe 2021-01-12Add htagml -xJune McEnroe 2021-01-12Prevent matching the same tag twiceJune McEnroe 2021-01-12Process htagml file line by lineJune McEnroe This simplifies some things, adds support for line number tag definitions, and should enable combining htagml with other preprocessors in the future. 2021-01-12Split fields by tab onlyJune McEnroe Also don't fail hard on non-forward-search definitions. 2021-01-12List both Makefile and html.sh under README.7June McEnroe 2021-01-12Add htagml exampleJune McEnroe 2021-01-12Use mandoc and htagml for bin htmlJune McEnroe 2021-01-12Add htagmlJune McEnroe 2021-01-12Replace causal.agency with a simple mdoc pageJune McEnroe 2021-01-11Publish "Using vi"June McEnroe 2021-01-11Enable diff.colorMovedJune McEnroe 2021-01-10Set less search case-insensitiveJune McEnroe 2021-01-10Set EXINITJune McEnroe neovim is laggy as hell in my OpenBSD VM, so I switched to vi so I could type without getting frustrated. 2021-01-09Add c -t flag to print expression typeJune McEnroe Also add missing float case. 2021-01-05Update taglineJune McEnroe