Skip to content

HTTPS clone URL

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
endif
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 "matchit.zip"
Bundle "delimitMate.vim"
Bundle "git.zip"
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://git.wincent.com/command-t.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://github.com/MarcWeber/vim-addon-mw-utils.git"
Bundle "git://github.com/tomtom/tlib_vim.git"
Bundle "git://github.com/honza/snipmate-snippets.git"
Bundle 'garbas/vim-snipmate'
" Turn on cool features
syntax on
filetype plugin indent on
"Omnicomplete
set ofu=syntaxcomplete#Complete
"SuperTab
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 %
endif
" indentation
set tabstop=2
set shiftwidth=2
set noexpandtab
"colors
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
endif
set list
"Invisible character olors
hi NonText guifg=#BCBCBC guibg=#232526
highlight SpecialKey guifg=#BCBCBC guibg=#232526
" wrapping lines
set wrap linebreak
"Statusbard
"statusline setup
set statusline=%f "tail of the filename
"Git
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
endif
" 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
if(bufexists(currbufnr))
let currbufname = bufname(currbufnr)
if(match(currbufname, a:pattern) > -1)
echo currbufnr . ": ". bufname(currbufnr)
let nummatches += 1
let firstmatchingbufnr = currbufnr
endif
endif
let currbufnr = currbufnr + 1
endwhile
if(nummatches == 1)
execute ":buffer ". firstmatchingbufnr
elseif(nummatches > 1)
let desiredbufnr = input("Enter buffer number: ")
if(strlen(desiredbufnr) != 0)
execute ":buffer ". desiredbufnr
endif
else
echo "No matching buffers"
endif
endfunction
" splits buffer vertically by number
function! BufVSplit(num)
execute ":vert sb ". a:num
endfunction
"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.