if [ "$TMUX" = "" ]; then tmux; fi # Make my history really long and include timestamps HISTFILE=~/.histfile HISTSIZE=10000000 SAVEHIST=10000000 setopt EXTENDED_HISTORY # logs the start and elapsed time setopt INC_APPEND_HISTORY setopt SHARE_HISTORY setopt HIST_IGNORE_DUPS setopt HIST_IGNORE_ALL_DUPS setopt HIST_FIND_NO_DUPS # Use this awesome project to combine history across tabs # https://github.com/larkery/zsh-histdb source $HOME/.oh-my-zsh/custom/plugins/zsh-histdb/sqlite-history.zsh autoload -Uz add-zsh-hook add-zsh-hook precmd histdb-update-outcome # oh-my-zsh config export ZSH="/Users/zackburt/.oh-my-zsh" ZSH_THEME="robbyrussell" COMPLETION_WAITING_DOTS="true" # install this plugin: https://github.com/popstas/zsh-command-time plugins=(git node nvm command-time) source $ZSH/oh-my-zsh.sh # I do not like that it auto highlights when I paste things in. zle_highlight=('paste:none') # brew install autojump [ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh # User configuration # My personal settings to make my terminal respect the osx bash command line shortcuts I've already committed to muscle memory bindkey -v bindkey "^A" vi-beginning-of-line bindkey "^E" vi-end-of-line bindkey "^K" kill-line bindkey "^D" delete-char bindkey "^F" vi-forward-char bindkey "^B" vi-backward-char bindkey '^[[A' history-beginning-search-backward bindkey "^N" history-beginning-search-forward bindkey '^R' history-incremental-search-backward bindkey '^F' history-incremental-search-forward bindkey "^[b" backward-word bindkey "^[f" forward-word bindkey "^[a" beginning-of-line bindkey "^[e" end-of-line # edit command line autoload -z edit-command-line zle -N edit-command-line bindkey "^X^E" edit-command-line # Update the command line to include timestamp of when commands start RPROMPT='[%D{%L:%M:%S %p}]' TMOUT=1 TRAPALRM() { zle reset-prompt } epoch() { date -j -f "%a %b %d %T %Z %Y" "`date`" "+%s" } # Update my history function just how I like it tshistory() { sqlite3 ${HISTDB_FILE} -cmd ".headers on" "select argv, human_readable_time from (select commands.argv,start_time,datetime(start_time,'unixepoch') || ' (' || duration || ' seconds)' as human_readable_time FROM history LEFT JOIN commands ON commands.id = history.command_id ORDER BY start_time DESC LIMIT 10) ORDER BY start_time ASC" ".exit" -separator " " }