Skip to content

Instantly share code, notes, and snippets.

@colegleason
Created April 11, 2012 13:17
Show Gist options
  • Save colegleason/2359241 to your computer and use it in GitHub Desktop.
Save colegleason/2359241 to your computer and use it in GitHub Desktop.
davesdots meets robbseaton
# .zshrc mashup of davesdots and robbseaton
# "compile slow, run fast." - family motto
export CFLAGS="-O3 -funsafe-loop-optimizations -ffast-math -march=native -pipe"
export CXXFLAGS=${CFLAGS}
# export LDFLAGS=${CFLAGS}
# I think I speak for everyone when I say "fuck gcc"
alias cc="clang -Wall -Wextra -Werror"
# matches current input to history items
# bind to up arrow and down arrow
# this will change your life and make traffic bearable
bindkey '^[[A' up-line-or-search
bindkey '^[[B' down-line-or-search
# COLORED LS, IT MAKES YOU SMARTER
alias ls="ls --color=always"
# when i put a process in the background,
# it's code for "fuck off and leave me alone"
unsetopt notify
# i feel bad for whoever implemented vi mode
# surely an alcoholic by now
bindkey -e
# don't assume i want to cd, that's fucking rude
unsetopt autocd
# seriously why does this shit even exist
unsetopt beep
# DON'T YOU YELL AT ME WHEN YOU CAN'T FIND A MATCH
# THAT'S YOUR PROBLEM, _NOT_ MINE
unsetopt nomatch
# the less i have to hit tab
# the better
setopt menu_complete
# because i love history, appendixes, and appending things
setopt appendhistory
# because someday i will learn advanced pattern matching
# it sounds very useful, like regexps
setopt extendedglob
# all this stuff was autogenerated and i have no idea what it all means
# just like life
zstyle ':completion:*' completer _expand _complete _ignored
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}'
zstyle ':completion:*' menu select=5
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle :compinstall filename '/home/cole/.zshrc'
autoload -Uz compinit
compinit
autoload -U colors
colors
# I LOVE HISTORY
# some people might say i love history too much
# i have never met these people
HISTFILE=~/.zsh_history
HISTSIZE=100000000
SAVEHIST=100000000
# Below code stolen from davesdots
case `uname -s` in
Darwin)
export LHOSTNAME=`scutil --get LocalHostName`
;;
*)
export LHOSTNAME=${HOST}
;;
esac
autoload compinit; compinit -d "${HOME}/.zsh/.zcompdump-${LHOSTNAME}"
autoload age
autoload zmv
if [ ${ZSH_VERSION//.} -gt 420 ] ; then
autoload -U url-quote-magic
zle -N self-insert url-quote-magic
fi
autoload -U edit-command-line
zle -N edit-command-line
# Keep track of other people accessing the box
watch=( all )
export LOGCHECK=30
export WATCHFMT=$'\e[00;00m\e[01;36m'" -- %n@%m has %(a.logged in.logged out) --"$'\e[00;00m'
# directory hashes
if [ -d "${HOME}/sandbox" ] ; then
hash -d sandbox="${HOME}/sandbox"
fi
if [ -d "${HOME}/work" ] ; then
hash -d work="${HOME}/work"
for dir in "${HOME}"/work/*(N-/) ; do
hash -d $(basename "${dir}")="${dir}"
done
fi
# common shell utils
if [ -d "${HOME}/.commonsh" ] ; then
for file in "${HOME}"/.commonsh/*(N.x:t) ; do
. "${HOME}/.commonsh/${file}"
done
fi
# extras
if [ -d "${HOME}/.zsh" ] ; then
for file in "${HOME}"/.zsh/*(N.x:t) ; do
. "${HOME}/.zsh/${file}"
done
fi
@robertseaton
Copy link

check fork for robbseaton-current, serious quality of life improvements

  • unified, synchronized history between shells, 100x better
  • searching backward through history fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment