# The following lines were added by compinstall zstyle ':completion:*' completer _expand _complete _ignored _approximate zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'm:{[:lower:]}={[:upper:]}' 'r:|[._-_]=** r:|=**' '' zstyle :compinstall filename '~/.zshrc' zle_highlight=(default:bold) autoload -Uz compinit -D && compinit autoload -U promptinit && promptinit autoload -U colors && colors autoload -Uz VCS_INFO_get_data_git && VCS_INFO_get_data_git 2> /dev/null setopt prompt_subst # End of lines added by compinstall # Lines configured by zsh-newuser-install HISTFILE=~/.zsh_history HISTSIZE=1000 SAVEHIST=1000 setopt appendhistory autocd extendedglob nomatch notify bindkey -e # End of lines configured by zsh-newuser-install export HOMEBREW_NO_ANALYTICS=1 export GOPATH=~/.go export GOBIN=$GOPATH/bin export TEXBIN=/Library/TeX/texbin/ export GHC_HOME=/usr/local/bin export CABAL_HOME=$HOME/.cabal/ export PATH=$GHC_HOME:$PATH:$CABAL_HOME/bin:/opt/local/bin:/usr/local/sbin:/usr/local/opt/llvm/bin:~/.local/bin:$GOBIN:~/.cargo/bin:$TEXBIN export MANPATH=$MANPATH:/opt/local/share/man:/usr/local/opt/erlang/lib/erlang/man export INFOPATH=$INFOPATH:/opt/local/share/info export PYTHONSTARTUP=~/.pythonrc export NODE_PATH=/usr/local/lib/node_modules export TERM=rxvt export LANG=en_US.UTF-8 export LC_ALL=$LANG export JAVA_HOME=`/usr/libexec/java_home -v 9` export GH_HOME=~/Documents/Code/Github export CARP_DIR=$GH_HOME/carp/Carp/ export EDITOR=/usr/local/bin/vim alias dob="git branch --merged | grep -vE '(\*)|(master)|(dev)' | xargs -n 1 git branch -d" alias vi="stty stop '' -ixoff ; stty erase '^?'; vim" alias em="emacs" alias mk="make" alias g="git" alias virtualenv2="python2.7 /usr/local/lib/python2.7/site-packages/virtualenv.py" alias ghci="ghci -v0" alias ghc-sandbox="ghc -no-user-package-db -package-db .cabal-sandbox/*-packages.conf.d" alias ghci-sandbox="ghci -no-user-package-db -package-db .cabal-sandbox/*-packages.conf.d" alias runhaskell-sandbox="runhaskell -no-user-package-db -package-db .cabal-sandbox/*-packages.conf.d" alias psg="ps aux | grep -v grep | grep -i -e VSZ -e" alias python="python3" alias pysh="ipython" alias pip2="/usr/local/bin/pip2" alias pip="pip3" alias setjdk="launchctl setenv STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk" alias cdg="cd $GH_HOME" alias cdgo="cd ~/.go/src" alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl" alias loc="cloc --read-lang-def=/Users/veitheller/.scripts/cloc.txt" alias ls="ls -a" alias pbclear="echo -n '' | pbcopy" PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[green]%}%m%{$reset_color%}"$'\n'"⇒ " expand-or-complete-with-dots(){ echo -n "e[31m.....\e[0m" zle expand-or-complete zle redisplay } zle -N expand-or-complete-with-dots bindkey "Î" expand-or-complete-with-dots precmd () {print -Pn "\e]2; %~/ \a"} preexec () {print -Pn "\e]2; %~/ \a"} case $TERM in xterm*) precmd(){print -Pn "\e]0;%m: %~\a"} ssh(){ PRENAME="`dcop $KONSOLE_DCOP_SESSION sessionName`"; dcop "$KONSOLE_DCOP_SESSION" renameSession "$@"; /usr/bin/ssh "$@"; dcop "$KONSOLE_DCOP_SESSION" renameSession "$PRENAME" } ;; esac function rprompt-git-current-branch { local name st color gitdir action name=`git rev-parse --abbrev-ref=loose HEAD 2> /dev/null` if [[ -z $name ]]; then return fi gitdir=`git rev-parse --git-dir 2> /dev/null` action=`VCS_INFO_git_getaction "$gitdir"` && action="($action)" st=`git status 2> /dev/null` if [[ -n `echo "$st" | grep "ahead of"` ]]; then color=%F{white} elif [[ -n `echo "$st" | grep "^nothing to"` ]]; then color=%F{green} elif [[ -n `echo "$st" | grep "^no changes added"` ]]; then color=%F{yellow} elif [[ -n `echo "$st" | grep "^# Changes to be committed"` ]]; then color=%B%F{red} else color=%B%F{blue} fi echo "%{$fg[white]%}$color$name$action%f%b%{$reset_color%} ∧ " } RPROMPT='∈ `rprompt-git-current-branch`' RPROMPT+="%{$reset_color%}%{$fg[yellow]%}%~%{$reset_color%}" save_dotfiles(){ local DOTPATH=~/Documents/Code/Github/.dotfiles/ cp -r ~/.scripts ${DOTPATH} rsync -av --exclude="libs" --exclude="history" --exclude="out" ~/.carp/ ${DOTPATH}carp > /dev/null cp ~/.config/alacritty/alacritty.yml ${DOTPATH} cp ~/.erc ${DOTPATH}erc cp ~/.gitconfig ${DOTPATH}gitconfig cp ~/.gitignore ${DOTPATH}gitignore cp ~/.inputrc ${DOTPATH}inputrc cp ~/.pythonrc ${DOTPATH}pythonrc cp ~/.sbclrc ${DOTPATH}sbclrc cp ~/.sbclirc ${DOTPATH}sbclirc cp ~/.valgrindrc ${DOTPATH}valgrindrc cp ~/.vimrc ${DOTPATH}vimrc cp ~/.zeptorc ${DOTPATH}zeptorc cp ~/.zshrc ${DOTPATH}zshrc } makepass(){ LEN=20 if [ $# -gt 0 ] ; then LEN=$1 fi cat /dev/urandom | base64 | head -c $LEN echo '' } massif() { valgrind --tool=massif --massif-out-file=massif.prof $1 && ms_print massif.prof | less } ###-begin-npm-completion-### # # npm command completion script # # Installation: npm completion >> ~/.bashrc (or ~/.zshrc) # Or, maybe: npm completion > /usr/local/etc/bash_completion.d/npm # COMP_WORDBREAKS=${COMP_WORDBREAKS/=/} COMP_WORDBREAKS=${COMP_WORDBREAKS/@/} export COMP_WORDBREAKS if type complete &>/dev/null; then _npm_completion () { local si="$IFS" IFS=$'\n' COMPREPLY=($(COMP_CWORD="$COMP_CWORD" \ COMP_LINE="$COMP_LINE" \ COMP_POINT="$COMP_POINT" \ npm completion -- "${COMP_WORDS[@]}" \ 2>/dev/null)) || return $? IFS="$si" } complete -o default -F _npm_completion npm elif type compdef &>/dev/null; then _npm_completion() { local si=$IFS compadd -- $(COMP_CWORD=$((CURRENT-1)) \ COMP_LINE=$BUFFER \ COMP_POINT=0 \ npm completion -- "${words[@]}" \ 2>/dev/null) IFS=$si } compdef _npm_completion npm elif type compctl &>/dev/null; then _npm_completion () { local cword line point words si read -Ac words read -cn cword let cword-=1 read -l line read -ln point si="$IFS" IFS=$'\n' reply=($(COMP_CWORD="$cword" \ COMP_LINE="$line" \ COMP_POINT="$point" \ npm completion -- "${words[@]}" \ 2>/dev/null)) || return $? IFS="$si" } compctl -K _npm_completion npm fi ###-end-npm-completion-### function ghcl { git clone git@github.com:$1.git } fortune | cowsay -f koala remind # eval `opam config env` fpath+=${ZDOTDIR:-~}/.zsh_functions