Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

345 lines (273 sloc) 6.962 kb
" basic
set t_Co=256
set nocompatible
filetype on " OSX workaround
filetype off
set nobackup
set backupdir=~/.vim/backup
set directory=˜/.vim/temp
set noautowrite
set autoread
set lazyredraw
set ttyfast
set modeline
set backspace=indent,eol,start
set ru
set wildmenu
set wildmode=list,full
set laststatus=2
set statusline=%F%m%r%h%w\ (%{&ff})
set more
set sidescrolloff=5
set linebreak
set nostartofline
set title
set cursorline
" no intro
set shortmess+=I
" persistent undo
if has("persistent_undo")
set undofile
set undodir=~/.vim/temp/undo
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
"my vundles
Bundle "Markdown"
Bundle "surround.vim"
Bundle "Align"
Bundle ""
Bundle "delimitMate.vim"
Bundle ""
Bundle "Gist.vim"
Bundle 'majutsushi/tagbar'
Bundle 'tpope/vim-fugitive'
Bundle 'scrooloose/nerdcommenter'
Bundle 'scrooloose/nerdtree'
Bundle 'Raimondi/delimitMate'
Bundle 'kevinw/pyflakes-vim'
Bundle 'vim-scripts/SuperTab-continued.'
" vim-scripts repos
Bundle 'rails.vim'
" non github repos
Bundle 'git://'
Bundle "pyflakes"
Bundle "VimDebug"
Bundle "coffee.vim"
Bundle "vim-coffee-script"
Bundle "SingleCompile"
Bundle "tpope/vim-vividchalk"
Bundle 'taq/vim-git-branch-info'
Bundle 'grayrest/vim-syntastic'
Bundle "git://"
Bundle "git://"
Bundle "git://"
Bundle 'garbas/vim-snipmate'
" Turn on cool features
syntax on
filetype plugin indent on
set ofu=syntaxcomplete#Complete
let g:SuperTabDefaultCompletionType = "context"
"let g:SuperTabContextDefaultCompletionType = 'keyword'
" auto reload vimrc
if has("autocmd")
autocmd! bufwritepost .vimrc source %
autocmd! bufwritepost .gvimrc source %
autocmd! bufwritepost vimrc source %
autocmd! bufwritepost gvimrc source %
" indentation
set tabstop=2
set shiftwidth=2
set noexpandtab
let g:CSApprox_attr_map = { 'bold' : 'bold', 'italic' : '', 'sp' : ''}
colorscheme vividchalk
"Command-T bindings
noremap <leader>t <Esc>:CommandT<CR>
noremap <leader>T <Esc>:CommandTFlush<CR>
noremap <leader>B <Esc>:CommandTBuffer<CR>
"Command-T Config
let g:CommandTMaxHeight=10
let g:CommandTMatchWindowAtTop=1
"NERDTree bindings
noremap <leader>p <Esc>:NERDTreeToggle<CR>
"Tagbar setings
let g:tagbar_ctags_bin = '/usr/bin/ctags'
"Tagbar bindings
let g:tagbar_usearrows = 1
nnoremap <leader>l :TagbarToggle<CR>
"clang_complete options
let g:clang_complete_copen=1
"allow backspacing over everything in insert mode
set backspace=indent,eol,start
"set my sh
set shell=/bin/zsh
"turn off lame toolbar
set guioptions-=T
"status etc
set showcmd
set showmode
" search features
set incsearch
set hlsearch
set ignorecase
set smartcase
nnoremap # :set hlsearch<cr>#
nnoremap / :set hlsearch<cr>/
nnoremap ? :set hlsearch<cr>?
nnoremap <silent> <C-l> :nohlsearch<CR><C-l>
"line numbers and shit
set rnu
au bufwrite * set rnu
" Shortcut to rapidly toggle `set list`
nmap <leader>l :set list!<CR>
" Use the same symbols as TextMate for tabstops and EOLs
if has('gui_running')
set listchars=tab:\ ,eol:¬
set transparency=15
set list
"Invisible character olors
hi NonText guifg=#BCBCBC guibg=#232526
highlight SpecialKey guifg=#BCBCBC guibg=#232526
" wrapping lines
set wrap linebreak
"statusline setup
set statusline=%f "tail of the filename
set statusline+=[%{GitBranchInfoString()}]
"Display a warning if file encoding isnt utf-8
set statusline+=%#warningmsg#
set statusline+=%{(&fenc!='utf-8'&&&fenc!='')?'['.&fenc.']':''}
set statusline+=%*
set statusline+=%h "help file flag
set statusline+=%y "filetype
set statusline+=%r "read only flag
set statusline+=%m "modified flag
" visual bell
set vb
" font
set guifont=Inconsolata:h12
" hides buffers
set hidden
"long hist
set history=1000
" ruler ftw
set ruler
"no swap
set noswapfile
set scrolloff=5
if has('mouse')
set mouse=a
set mousef
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
" Also don't do it when the mark is in the first line, that is the default
" position when opening a file.
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
"auto indent
set autoindent
" CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo,
" so that you can undo CTRL-U after inserting a line break.
inoremap <C-U> <C-G>u<C-U>
" nice remaps
map ˜ ~
nnoremap <tab> :
nmap W w
nmap w1 w!
nmap q1 q!
vmap j gj
vmap k gk
nmap j gj
nmap k gk
"buffer exp
map <Leader>b :MiniBufExplorer<cr>
" MiniBuff explorer settings
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1
" search buffer by pattern.
function! BufSel(pattern)
let bufcount = bufnr("$")
let currbufnr = 1
let nummatches = 0
let firstmatchingbufnr = 0
while currbufnr <= bufcount
let currbufname = bufname(currbufnr)
if(match(currbufname, a:pattern) > -1)
echo currbufnr . ": ". bufname(currbufnr)
let nummatches += 1
let firstmatchingbufnr = currbufnr
let currbufnr = currbufnr + 1
if(nummatches == 1)
execute ":buffer ". firstmatchingbufnr
elseif(nummatches > 1)
let desiredbufnr = input("Enter buffer number: ")
if(strlen(desiredbufnr) != 0)
execute ":buffer ". desiredbufnr
echo "No matching buffers"
" splits buffer vertically by number
function! BufVSplit(num)
execute ":vert sb ". a:num
"Bind the BufSel() function to a user-command
command! -nargs=1 Bs :call BufSel("<args>")
command! -nargs=1 Vbuff :call BufVSplit("<args>")
map <leader>be :Bs
map <leader>bv :Vbuff
map <leader>bs :sbuff
map <leader>x :BufClose<CR>
" \1 \2 etc go to buffer 1/2 etc
nnoremap <Leader>1 :1b<CR>
nnoremap <Leader>2 :2b<CR>
nnoremap <Leader>3 :3b<CR>
nnoremap <Leader>4 :4b<CR>
nnoremap <Leader>5 :5b<CR>
nnoremap <Leader>6 :6b<CR>
nnoremap <Leader>7 :7b<CR>
nnoremap <Leader>8 :8b<CR>
nnoremap <Leader>9 :9b<CR>
nnoremap <Leader>0 :10b<CR>
"forgot to sudo? save anyway!
cmap w!! %!sudo tee > /dev/null %
"fuck you, I want nice clipboard ftw
set clipboard=unnamed
" Quickly set comma or semicolon at the end of the string
inoremap ,, <End>,
inoremap ;; <End>;
setlocal noet
" Optimize Windows
set winminheight=0
map <C-J> <C-W>j<C-W>_
map <C-K> <C-W>k<C-W>_
map <C-H> <C-W>h
map <C-L> <C-W>l
" Optimize Tabs
map <C-t><up> :tabr<cr>
map <C-t><down> :tabl<cr>
map <C-t><left> :tabp<cr>
map <C-t><right> :tabn<cr>
map <C-t>q :tabc<cr>
map <C-t>c :tabnew<cr>
map <C-t>l :tabs<cr>
Jump to Line
Something went wrong with that request. Please try again.