Skip to content

Instantly share code, notes, and snippets.

@echochamber
Last active Aug 29, 2015
Embed
What would you like to do?
Dotfiles
export PATH="$(brew --prefix php55)/bin:$PATH"
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
function color_my_prompt {
local __default_color="\[\033[37m\]"
local __text_color="\[\033[0;37m\]"
local __user_and_host="\[\033[0;32m\]\u @ \h$__default_color"
local __cur_location="\[\033[0;36m\]\w$__default_color"
local __git_branch_color="\[\033[1;31m\]"
git --version 2>&1 >/dev/null # improvement by tripleee
GIT_IS_AVAILABLE=$?
if [ $GIT_IS_AVAILABLE -eq 0 ]; then
local __git_branch='`git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\*\ \(.+\)$/\\\\\1\/`'
local __git_branch_display=$__git_branch_color"branch: "$__git_branch$__default_color
else
__git_branch_display=$__git_branch_color"branch: git isn't installed"$__default_color
fi
local __prompt_tail="\[\033[01;34m\]$"$__default_color
local __last_color="\[\033[00m\]"
PS1="\n"$__default_color
PS1=$PS1"┌─["$__user_and_host"]-["$__cur_location]"\n"
PS1=$PS1"├─["$__git_branch_display"]\n"
PS1=$PS1"└─["$__prompt_tail"]>"$__last_color" "
export PS1;
}
color_my_prompt
. ~/.bash_aliases
. ~/.profile
export PATH="$PATH:$HOME/.composer/vendor/bin"
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
[user]
name =
email =
[core]
editor = vim
[color]
ui = true
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red reverse
new = green reverse
whitespace = white reverse
[alias]
conflicts = !git ls-files -u | cut -f 2 | sort -u
fshow = ! sh -c 'git show --pretty="format:" --name-only $1 | grep -v "^$" | uniq | sed -e "s#^#`git rev-parse --show-toplevel`/#"' -
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
ldf = "!f() { git diff --name-only \"$(git merge-base HEAD ${1:-origin/master})\"; }; f"
set nocompatible " Disable vi-compatibility
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Bundle 'gmarik/vundle'
" My Bundles
" Color Scheme
Bundle 'flazz/vim-colorschemes'
set background=light
"Nerdtree Folder Management
Bundle 'scrooloose/nerdtree'
"Powerline: Cool thing at bottom of screep
Bundle 'Lokaltog/powerline'
call vundle#end()
filetype plugin indent on
set t_Co=256
colorscheme xoria256
syntax enable
set guifont=Menlo\ 16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
set showmode " always show what mode we're currently editing in
set nowrap " don't wrap lines
set tabstop=4 " a tab is four spaces
set smarttab
set tags=tags
set softtabstop=4 " when hitting <BS>, pretend like a tab is removed, even if spaces
set expandtab " expand tabs by default (overloadable per file type later)
set shiftwidth=4 " number of spaces to use for autoindenting
set shiftround " use multiple of shiftwidth when indenting with '<' and '>'
set backspace=indent,eol,start " allow backspacing over everything in insert mode
set autoindent " always set autoindenting on
set copyindent " copy the previous indentation on autoindenting
set number " always show line numbers
set ignorecase " ignore case when searching
set smartcase " ignore case if search pattern is all lowercase,
set timeout timeoutlen=200 ttimeoutlen=100
set visualbell " don't beep
set noerrorbells " don't beep
set autowrite "Save on buffer switch
set mouse=a
" With a map leader it's possible to do extra key combinations
" like <leader>w saves the current file
let mapleader = ","
let g:mapleader = ","
" Down is really the next line
nnoremap j gj
nnoremap k gk
"Easy escaping to normal model
imap jj <esc>
"Auto change directory to match current file ,cd
nnoremap ,cd :cd %:p:h<CR>:pwd<CR>
"easier window navigation
nmap <C-h> <C-w>h
nmap <C-j> <C-w>j
nmap <C-k> <C-w>k
nmap <C-l> <C-w>l
" Make control C copy to the clipboard
nmap <C-c> "+y
nmap <C-n> :NERDTreeToggle<cr>
"Show (partial) command in the status line
set showcmd
" Create split below
nmap :sp :rightbelow sp<cr>
" Quickly go forward or backward to buffer
nmap :bp :BufSurfBack<cr>
nmap :bn :BufSurfForward<cr>
highlight Search cterm=underline
" Swap files out of the project root
set backupdir=~/.vim/backup/
set directory=~/.vim/swap/
" Auto-remove trailing spaces
autocmd BufWritePre *.php :%s/\s\+$//e
" Open splits
nmap vs :vsplit<cr>
nmap sp :split<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment