Skip to content

Instantly share code, notes, and snippets.

@rhwlo
Created August 2, 2018 15:28
Show Gist options
  • Save rhwlo/efccfb1f69d04f413b4d18b510332ccf to your computer and use it in GitHub Desktop.
Save rhwlo/efccfb1f69d04f413b4d18b510332ccf to your computer and use it in GitHub Desktop.
set editing-mode vi
set keymap vi
set convert-meta on
# pretend to be screen sometimes
unbind C-b
set -g prefix C-a
bind-key a send-prefix
bind-key '"' choose-window
bind-key K confirm kill-window
# vi is best
setw -g mode-keys vi
# splitting panes
bind-key '-' split-window -v
bind-key '|' split-window -h
# make navigation more paneful
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key -r C-h resize-pane -L
bind-key -r C-j resize-pane -D
bind-key -r C-k resize-pane -U
bind-key -r C-l resize-pane -R
set-option -g status-left '#h'
set -g status-right '%Y-%m-%d %H:%M:%S#'
set -g status-interval 1
setw -g automatic-rename on
bind r source-file ~/.tmux.conf
# copy and paste!
bind -t vi-copy y copy-pipe "xclip -in -selection clipboard"
bind ']' run "xclip -out -selection clipboard | tmux load-buffer - && tmux paste-buffer"
# UTF-8!
set -g status-utf8 on
set-window-option -g utf8 on
set -g default-terminal "screen-256color"
execute pathogen#infect()
set history=1000
filetype on
filetype plugin on
filetype detect
filetype indent on
syntax on
syntax enable
set background=dark
set ic
set hlsearch
set incsearch
set showmatch
" default tab settings
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set autoindent
" Makefile tab settings
au BufEnter Makefile set noexpandtab tabstop=4 shiftwidth=4
" YAML tab settings
au BufEnter *.y{a,}ml set expandtab softtabstop=2 shiftwidth=2 tabstop=2
" HTML tab settings
au BufEnter *.htm{,l} set expandtab softtabstop=1 shiftwidth=1
au BufEnter *.m{,k}d set syntax=markdown tw=100
set wrap
set showcmd
set laststatus=2 " always display status line
set ruler
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()
autocmd! BufNewFile,BufRead *.ino setlocal ft=arduino
set clipboard=unnamed
set cul
# Colors are nice.
autoload -U colors && colors
# Set specific histories, etc., for the different hosts.
autoload -U compinit
compinit -d ~/.zcompdumps/`hostname -s`
setopt autocd
export EDITOR="vim"
export GOROOT="/usr/local/go"
export GOPATH="${HOME}/go"
export HISTFILE=~/.histfile-`hostname -s`
export HISTSIZE=1000
export SCALA_HOME="/usr/local/share/scala"
export PATH="${HOME}/.local/bin:${PATH}:${HOME}/bin:${SCALA_HOME}/bin:${HOME}/.cabal/bin:${GOROOT}/bin:$(npm bin):${HOME}/pebble-dev/pebble-sdk-4.5-linux64/bin"
for binpath in $(find /opt -maxdepth 3 -name 'bin' -type 'd'); do
test -x $binpath && PATH="${PATH}:${binpath}"
done
# Include things from ~/.luarocks and ~/lib
for addl_lua_path in {${HOME}/.luarocks/{lib,share},${HOME}/lib}/lua/5.1/\?{,/init}.lua; do
LUA_LOCAL_PATHS="${LUA_LOCAL_PATHS};${addl_lua_path}"
done
export LUA_PATH="${LUA_PATH};${LUA_LOCAL_PATHS}"
export SAVEHIST=5000
export SVN_EDITOR=$EDITOR
export VISUAL=$EDITOR
export ELM_HOME="/usr/local/lib/node_modules/elm/share"
bindkey -v
# 'Home' key
bindkey -M viins "\e[H" beginning-of-line
bindkey -M vicmd "\e[H" beginning-of-line
# 'End' key
bindkey -M viins "\e[F" end-of-line
bindkey -M vicmd "\e[F" end-of-line
bindkey -M viins OF end-of-line
# {jj,JJ} => <ESC>
bindkey -M viins "jj" vi-cmd-mode
bindkey -M viins "JJ" vi-cmd-mode
# Annoying not to have
bindkey -M viins '^r' history-incremental-search-backward
bindkey -M vicmd '^r' history-incremental-search-backward
# The following lines were added by compinstall
zstyle :compinstall filename '~/.zshrc'
# End of lines added by compinstall
# We want our completions to be colorful
zmodload -a zcomplist
# Aliases and functions
if [ -d ~/.zfunctions ] ;then
fpath=(~/.zfunctions $fpath)
autoload -U ${fpath[1]}/* 2>/dev/null >&2
autoload -U ${fpath[1]}/*.zwc(:t) 2>/dev/null >&2
fi
[ -f ~/.aliases ] && source ~/.aliases
[ -f ~/.functions ] && source ~/.functions
autoload -Uz vcs_info
zstyle ':vcs_info:*' enable git svn
# precmd is called just before the prompt is printed
function precmd() {
originalPathSections=$(echo -n $ORIG_PATH | sed -re "s@[^:]*@@g" | wc -c)
currentPathSections=$(echo -n $PATH | sed -re "s@[^:]*@@g" | wc -c)
if [[ $ORIG_PATH != $PATH ]]; then
path_modifications=$((currentPathSections - originalPathSections))
else
path_modifications=0
fi
prompt_time="%{$fg[cyan]%}%D{%H:%M:%S}%{$reset_color%}"
power_info="$(powerPrompt)"
working_dir="%{$fg[green]%}%~%{$reset_color%}"
if [ $path_modifications -gt 0 ]; then
virtual_env_info=" %{$fg[red]%}{${path_modifications}}%{$reset_color%}"
else
virtual_env_info=" %{$fg[green]%}{${path_modifications}}%{$reset_color%}"
fi
PROMPT="$prompt_time $power_info${virtual_env_info} $working_dir
%{$bg[cyan]$fg[black]%}%m%{$reset_color%} %{$fg[yellow]%}%#%{$reset_color%} "
vcs_info
print -Pn "\e]0;%n@%m: %~\a"
last_exit_status="%(?.%{$fg[green]%}+%{$reset_color%}.%{$fg[red]%}%?%{$reset_color%})"
if [ -n "$vcs_info_msg_0_" ]; then
vcs_info_or_time="%{$fg[blue]%}${vcs_info_msg_0_}%{$reset_color%}"
else
vcs_info_or_time="%{$fg[blue]%}%D{%s}%{$reset_color%}"
fi
RPROMPT="${last_exit_status} ${vcs_info_or_time}"
}
# system-wide aliases
# We like ls with colors, but it's different on FreeBSD vs Linux
eval `dircolors -b`
alias ls='ls --color'
zstyle ':completion:*' list-colors '' # use gdircolors
alias grep='grep --color'
# Last but not least, the prompt
prompt_time="%{$fg[cyan]%}%D{%H:%M:%S}%{$reset_color%}"
unames="%{$fg[cyan]%}`uname -s`%{$reset_color%}"
working_dir="%{$fg[green]%}%~%{$reset_color%}"
alias vless='/usr/share/vim/vim72/macros/less.sh'
export PYTHONDONTWRITEBYTECODE=1
# a fortune!
#$HOME/bin/markov_chain $HOME/tasting_notes_only
#echo
# vim:ts=4:ft=zsh
### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
export ORIG_PATH=${PATH}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment