Skip to content

Instantly share code, notes, and snippets.

@machuga
Created July 13, 2012 11:04
Show Gist options
  • Save machuga/3104291 to your computer and use it in GitHub Desktop.
Save machuga/3104291 to your computer and use it in GitHub Desktop.
Vimrc file 07-13-2012
set nocompatible
set number
set ruler
syntax on
" Set encoding
set encoding=utf-8
" Whitespace stuff
set nowrap
set tabstop=4
set shiftwidth=4
set softtabstop=4
set linespace=2
set scrolloff=5
set expandtab
set list listchars=tab:\ \ ,trail:·
set autoindent
set smartindent
set cpoptions+=$
set guioptions-=T
set virtualedit=block
set splitbelow
set guifont=Inconsolata-g\ for\ Powerline:h15
if &term != "xterm-color"
if has("gui-running")
let g:solarized_termcolors=256
set t_Co=16
set background=light
colorscheme solarized
else
"let g:solarized_termcolors=256
set t_Co=16
set background=dark
colorscheme solarized
endif
endif
" Don't list hiddens set list listchars=tab:\ \ ,trail:·
" Searching
set hlsearch
set incsearch
set ignorecase
set smartcase
highlight Search cterm=underline
"set cursorline
"highlight Cursorline cterm=underline
" Code folding
set foldenable
nnoremap <leader>ft Vatzf
" Tab completion
set wildmode=list:longest,list:full
set wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/*
" Status bar
set laststatus=2
" Without setting this, ZoomWin restores windows in a way that causes
" equalalways behavior to be triggered the next time CommandT is used.
" This is likely a bludgeon to solve some other issue, but it works
set noequalalways
" NERDTree configuration
let NERDTreeIgnore=['\.pyc$', '\.rbc$', '\~$']
map <Leader>n :NERDTreeToggle<CR>
" ZoomWin configuration
map <Leader><Leader> :ZoomWin<CR>
" make uses real tabs
au FileType make set noexpandtab
" Thorfile, Rakefile, Vagrantfile and Gemfile are Ruby
au BufRead,BufNewFile {Gemfile,Rakefile,Vagrantfile,Thorfile,config.ru} set ft=ruby
" md, markdown, and mk are markdown and define buffer-local preview
au BufRead,BufNewFile *.{md,markdown,mdown,mkd,mkdn} call s:setupMarkup()
" add json syntax highlighting
au BufNewFile,BufRead *.json set ft=javascript
" Use Twig for Blade
"au BufNewFile,BufRead *.blade.php set ft=twig
au FileType blade set textwidth=0
" make Python follow PEP8 ( http://www.python.org/dev/peps/pep-0008/ )
au FileType python set softtabstop=4 tabstop=4 shiftwidth=4 textwidth=79
" make Ruby use 2 spaces
au FileType ruby set softtabstop=2 tabstop=2 shiftwidth=2 textwidth=79
au FileType coffee set softtabstop=2 tabstop=2 shiftwidth=2 textwidth=79
au FileType slim set softtabstop=2 tabstop=2 shiftwidth=2 textwidth=79
au FileType haml set softtabstop=2 tabstop=2 shiftwidth=2 textwidth=79
au FileType erb set softtabstop=2 tabstop=2 shiftwidth=2 textwidth=79
au FileType ujs set softtabstop=2 tabstop=2 shiftwidth=2 textwidth=79
" make PHP conform to Fuel standards
au FileType php set softtabstop=4 tabstop=4 shiftwidth=4 textwidth=79 noexpandtab
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
" load the plugin and indent settings for the detected filetype
filetype plugin indent on
" Unimpaired configuration
" Bubble single lines
nmap <C-Up> [e
nmap <C-Down> ]e
" Bubble multiple lines
vmap <C-Up> [egv
vmap <C-Down> ]egv
" Enable syntastic syntax checking
let g:syntastic_enable_signs=1
let g:syntastic_quiet_warnings=1
" gist-vim defaults
if has("mac")
let g:gist_clip_command = 'pbcopy'
elseif has("unix")
let g:gist_clip_command = 'xclip -selection clipboard'
endif
let g:gist_detect_filetype = 1
let g:gist_open_browser_after_post = 1
" Use modeline overrides
set modeline
set modelines=10
" Directories for swp files
set backupdir=~/.vim/backup
set directory=~/.vim/backup
" MacVIM shift+arrow-keys behavior (required in .vimrc)
let macvim_hig_shift_movement = 1
" % to bounce from do to end etc.
runtime! macros/matchit.vim
" Show (partial) command in the status line
set showcmd
" Include local vim config
if filereadable(expand("~/.vimrc.local"))
source ~/.vimrc.local
endif
if has('mouse')
set mouse=a
endif
if has("autocmd")
autocmd FileType python set complete+=k/Users/machuga/.vim/pydiction-0.5/pydiction isk+=.,(
autocmd bufwritepost .vimrc source ~/.vimrc
autocmd bufwritepost .vimrc.local source ~/.vimrc
endif " has("autocmd"
nnoremap ,h <C-W>h
nnoremap ,j <C-W>j
nnoremap ,k <C-W>k
nnoremap ,l <C-W>l
nnoremap ,H <C-W>H
nnoremap ,J <C-W>J
nnoremap ,K <C-W>K
nnoremap ,L <C-W>L
nnoremap <Leader>] :noh <CR>
nnoremap <Leader>p :set paste<CR>
nnoremap <Leader>o :set nopaste<CR>
vmap <C-x> :!pbcopy<CR>
vmap <C-c> :w !pbcopy<CR><CR>
" Command-T configuration
let g:CommandTMaxHeight=20
let g:Powerline_colorscheme = 'skwp'
let g:Powerline_symbols = 'fancy'
"NerdTREE
" nmap ,nt :NERDTree<CR>
" left NERDTreeShowHidden=1
# Path to oh-my-zsh configuration.
export DISABLE_AUTO_UPDATE=true
export DISABLE_AUTO_TITLE=true
export ZSH=$HOME/.oh-my-zsh
export ZSH_THEME="machuga"
# Setup paths
export PATH=/usr/local/bin:/Users/machuga/.rvm/bin:/usr/bin:/opt/local/bin:/opt/local/sbin:/Users/machuga/bin:.:$PATH
# Load oh-my-zsh plugins
plugins=(git rvm ruby)
source $ZSH/oh-my-zsh.sh
# Environment variables
export EDITOR="vim"
export LSCOLORS="ExGxBxDxCxEgEdxbxgxcxd"
export GREP_OPTIONS="--color"
export ACK_COLOR_MATCH="red"
export WORDCHARS='*?[]~&;!$%^<>'
# Aliases
alias mysql=/usr/local/mysql/bin/mysql
alias mysqladmin=/usr/local/mysql/bin/mysqladmin
alias la="ls -la"
alias vi="mvim -v"
alias vim="mvim -v"
alias gvim='/Applications/MacVim.app/Contents/MacOS/Vim -g'
alias start_pgsql="pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start"
alias stop_pgsql="pg_ctl -D /usr/local/var/postgres stop -s -m fast"
alias start_mongo="mongod run --config /usr/local/Cellar/mongodb/2.0.2-x86_64/mongod.conf"
# Git Aliases
alias gs="git status"
alias gb="git branch"
alias ga="git add"
alias gaa="git add -A"
alias gco="git checkout"
alias gcam="git commit -a -m"
alias gffs="git flow feature start"
alias gfff="git flow feature finish"
alias gpusho="git push origin"
alias gpullo="git pull origin"
alias gpod="git push origin develop"
alias tail_apache="tail -f /var/log/apache2/error_log | perl -pe 's/\[[a-zA-Z0-9 :\.]+\]/\e[1;31;m$&\e[0m/g'"
alias tail_phpar="tail -f ~/Sites/perfectpetmatch/dashboard/fuel/app/logs/phpar.log | perl -pe 's/\(Time:\s+([a-zA-Z0-9 :\.]+)\)/\e[1;31;m$&\e[0m/g'"
alias edit_vhosts="vi /etc/apache2/extra/httpd-vhosts.conf"
alias php5-4-s="php -S localhost:8888"
alias clojure="rlwrap clj"
# Less Colors for Man Pages
export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking
export LESS_TERMCAP_md=$'\E[01;38;5;74m' # begin bold
export LESS_TERMCAP_me=$'\E[0m' # end mode
export LESS_TERMCAP_se=$'\E[0m' # end standout-mode
export LESS_TERMCAP_so=$'\E[38;5;246m' # begin standout-mode - info box
export LESS_TERMCAP_ue=$'\E[0m' # end underline
export LESS_TERMCAP_us=$'\E[04;38;5;146m' # begin underline
# Set default email for Rails
export DIGITELL_USERNAME="[email protected]"
export DIGITELL_PASSWORD="maqua11machm"
export LARAVEL_ENV="test"
# Function for making PDF versions of man pages
function pman() {
man $1 -t | open -f -a Preview
}
# This function jsonify's something or another, need to look into it
function pj() {
python -mjson.tool
}
if [ -f `brew --prefix`/etc/autojump ]; then
. `brew --prefix`/etc/autojump
fi
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment