summary refs log tree commit diff
path: root/home/.zshrc
diff options
context:
space:
mode:
authorJune McEnroe <programble@gmail.com>2017-09-06 13:06:36 -0400
committerJune McEnroe <programble@gmail.com>2017-09-06 13:07:36 -0400
commite08e024226086df183dccf15647903670f4e0914 (patch)
tree7966495a24a637797b5ef4b57b2a419ae8a7853e /home/.zshrc
parentPass final NULL to execlp (diff)
downloadsrc-e08e024226086df183dccf15647903670f4e0914.tar.gz
src-e08e024226086df183dccf15647903670f4e0914.zip
Rename curtis -> home
Why the heck did I do this?
Diffstat (limited to 'home/.zshrc')
-rw-r--r--home/.zshrc69
1 files changed, 69 insertions, 0 deletions
diff --git a/home/.zshrc b/home/.zshrc
new file mode 100644
index 00000000..77e4569d
--- /dev/null
+++ b/home/.zshrc
@@ -0,0 +1,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)