2012-03-29 06:31:02 +11:00
|
|
|
augroup bundles
|
|
|
|
autocmd!
|
|
|
|
|
2013-11-06 18:39:35 +11:00
|
|
|
if has('vim_starting')
|
|
|
|
set nocompatible
|
|
|
|
set runtimepath+=~/.vim/bundle/neobundle.vim/
|
|
|
|
endif
|
2012-03-29 06:31:02 +11:00
|
|
|
|
2013-11-06 18:39:35 +11:00
|
|
|
call neobundle#rc(expand('~/.vim/bundle/'))
|
2012-03-29 06:31:02 +11:00
|
|
|
|
2013-11-06 18:39:35 +11:00
|
|
|
" Let NeoNeoBundle manage NeoBundle
|
|
|
|
NeoBundleFetch 'Shougo/neobundle.vim'
|
|
|
|
|
|
|
|
NeoBundle 'Shougo/vimproc', {
|
|
|
|
\ 'build' : {
|
|
|
|
\ 'mac' : 'make -f make_mac.mak',
|
|
|
|
\ 'unix' : 'make -f make_unix.mak',
|
|
|
|
\ },
|
|
|
|
\ }
|
2012-03-29 06:31:02 +11:00
|
|
|
|
|
|
|
" Languages/Syntaxes/Frameworks {{{
|
|
|
|
" Ruby {{{
|
2013-11-06 18:39:35 +11:00
|
|
|
NeoBundleLazy 'vim-ruby/vim-ruby'
|
|
|
|
NeoBundleLazy 'tpope/vim-endwise'
|
|
|
|
NeoBundleLazy 'tpope/vim-rake'
|
|
|
|
NeoBundleLazy 'thisivan/vim-ruby-matchit'
|
|
|
|
NeoBundleLazy 'nelstrom/vim-textobj-rubyblock', { 'depends' : 'kana/vim-textobj-user' }
|
|
|
|
autocmd FileType ruby NeoBundleSource
|
|
|
|
\ vim-ruby
|
|
|
|
\ vim-rake
|
|
|
|
\ vim-endwise
|
|
|
|
\ vim-haml
|
|
|
|
\ vim-ruby-matchit
|
|
|
|
\ vim-textobj-rubyblock
|
2012-03-29 06:31:02 +11:00
|
|
|
" }}}
|
|
|
|
|
2012-08-18 13:25:47 +10:00
|
|
|
" Clojure {{{
|
2013-11-06 18:39:35 +11:00
|
|
|
NeoBundleLazy 'paredit.vim'
|
|
|
|
NeoBundleLazy 'VimClojure'
|
2012-03-29 06:31:02 +11:00
|
|
|
let g:vimclojure#ParenRainbow = 1
|
2012-08-18 13:25:47 +10:00
|
|
|
let vimclojure#FuzzyIndent = 1
|
2013-11-06 18:39:35 +11:00
|
|
|
autocmd FileType clojure,clojurescript set lispwords-='->'
|
|
|
|
autocmd FileType clojure,clojurescript set lispwords-='->>'
|
|
|
|
autocmd FileType clojure,clojurescript NeoBundleSource paredit.vim VimClojure
|
2012-03-29 06:31:02 +11:00
|
|
|
" }}}
|
|
|
|
|
|
|
|
" Markdown/Textile/etc {{{
|
2013-11-06 18:39:35 +11:00
|
|
|
NeoBundleLazy 'tpope/vim-markdown'
|
|
|
|
NeoBundleLazy 'matthias-guenther/hammer.vim'
|
|
|
|
autocmd FileType markdown NeoBundleSource vim-markdown hammer.vim
|
2012-03-29 06:31:02 +11:00
|
|
|
" }}}
|
|
|
|
|
|
|
|
" HTML/CSS/Javascript {{{
|
2013-11-06 18:39:35 +11:00
|
|
|
NeoBundleLazy 'tpope/vim-haml', { 'autoload' : { 'filetypes' : 'haml' } }
|
|
|
|
NeoBundleLazy 'kchmck/vim-coffee-script', { 'autoload' : { 'filetypes' : 'coffee' } }
|
|
|
|
NeoBundleLazy 'pangloss/vim-javascript', { 'autoload' : { 'filetypes' : 'javascript' } }
|
|
|
|
NeoBundleLazy 'css3', { 'autoload' : { 'filetypes' : 'css' } }
|
|
|
|
NeoBundleLazy 'othree/html5-syntax.vim', { 'autoload' : { 'filetypes' : 'html' } }
|
|
|
|
NeoBundleLazy 'slim-template/vim-slim', { 'autoload' : { 'filetypes' : 'slim' } }
|
2012-03-29 06:31:02 +11:00
|
|
|
" }}}
|
2011-09-21 08:26:27 +10:00
|
|
|
|
2012-03-29 06:31:02 +11:00
|
|
|
" }}}
|
2011-12-14 10:44:35 +11:00
|
|
|
|
2012-03-29 06:31:02 +11:00
|
|
|
" Git {{{
|
2013-11-06 18:39:35 +11:00
|
|
|
NeoBundle 'tpope/vim-fugitive', { 'augroup': 'fugitive' }
|
|
|
|
NeoBundle 'tpope/vim-git'
|
|
|
|
NeoBundle 'tjennings/git-grep-vim'
|
2011-09-21 08:26:27 +10:00
|
|
|
" }}}
|
|
|
|
|
2012-03-29 06:31:02 +11:00
|
|
|
" Text objects {{{
|
2013-11-06 18:39:35 +11:00
|
|
|
NeoBundle 'michaeljsmith/vim-indent-object'
|
|
|
|
NeoBundle 'argtextobj.vim'
|
2011-12-14 10:53:25 +11:00
|
|
|
" }}}
|
|
|
|
|
2012-03-29 06:31:02 +11:00
|
|
|
" Utility {{{
|
|
|
|
|
2013-11-06 18:39:35 +11:00
|
|
|
NeoBundle 'tpope/vim-surround'
|
2012-03-29 06:31:02 +11:00
|
|
|
|
2013-11-06 18:39:35 +11:00
|
|
|
NeoBundle 'Raimondi/delimitMate'
|
2012-03-29 06:31:02 +11:00
|
|
|
autocmd FileType clojure let delimitMate_quotes = "\""
|
|
|
|
|
2013-11-06 18:39:35 +11:00
|
|
|
NeoBundle 'AutoComplPop'
|
2012-03-29 06:31:02 +11:00
|
|
|
let g:acp_enableAtStartup = 0
|
|
|
|
let g:acp_completeoptPreview = 1
|
|
|
|
let g:acp_behaviorKeywordLength = 3
|
|
|
|
let g:acp_behaviorKeywordIgnores = [
|
|
|
|
\ 'the', 'def', 'end',
|
|
|
|
\ 'else', 'elsif', 'elif', 'endif', 'then',
|
|
|
|
\ 'case', 'done', 'do'
|
|
|
|
\ ]
|
|
|
|
|
2013-11-06 18:39:35 +11:00
|
|
|
NeoBundle 'Lokaltog/vim-easymotion'
|
2012-03-29 06:31:02 +11:00
|
|
|
let g:EasyMotion_keys = "arstdhneio" " Colemak home row
|
|
|
|
|
2013-11-06 18:39:35 +11:00
|
|
|
NeoBundle 'Lokaltog/vim-powerline'
|
2012-03-29 06:31:02 +11:00
|
|
|
|
2013-11-06 18:39:35 +11:00
|
|
|
NeoBundle 'Gundo'
|
2012-03-29 06:31:02 +11:00
|
|
|
nnoremap <Leader>u :GundoToggle<CR>
|
|
|
|
|
2013-11-06 18:39:35 +11:00
|
|
|
NeoBundle 'kien/rainbow_parentheses.vim'
|
2012-03-29 06:31:02 +11:00
|
|
|
autocmd VimEnter *.{rb,coffee} RainbowParenthesesToggle
|
|
|
|
autocmd Syntax *.{rb,coffee} RainbowParenthesesLoadRound
|
|
|
|
autocmd Syntax *.{rb,coffee} RainbowParenthesesLoadSquare
|
|
|
|
autocmd Syntax *.{rb,coffee} RainbowParenthesesLoadBraces
|
|
|
|
|
2013-11-06 18:39:35 +11:00
|
|
|
NeoBundle 'Tabular'
|
2012-03-29 06:31:02 +11:00
|
|
|
autocmd VimEnter * AddTabularPattern! first_eq /\%(=.*\)\@<!=[>=]\@!/l1c1l0
|
|
|
|
autocmd VimEnter * AddTabularPattern! first_rocket /\%(=>.*\)\@<!=>/l1c1l0
|
|
|
|
autocmd VimEnter * AddTabularPattern! first_key /\v%(%(\h\w*|"[^"]+"):.*)@<!%(\h\w*|"[^"]+")\zs:/l0l1
|
|
|
|
|
|
|
|
" mark, select indent level, tabularize, go to mark
|
2013-11-06 18:39:35 +11:00
|
|
|
nmap <silent> <Leader>a= mT:Tabularize first_eq<CR>`T
|
2012-03-29 06:31:02 +11:00
|
|
|
nmap <silent> <Leader>a> mT:Tabularize first_rocket<CR>`T
|
|
|
|
nmap <silent> <Leader>a: mT:Tabularize first_key<CR>`T
|
|
|
|
|
|
|
|
vmap <silent> <Leader>a= :Tabularize first_eq<CR>gv
|
|
|
|
vmap <silent> <Leader>a> :Tabularize first_rocket<CR>gv
|
|
|
|
vmap <silent> <Leader>a: :Tabularize first_key<CR>gv
|
|
|
|
|
|
|
|
" Auto-align
|
|
|
|
"" Cucumber
|
|
|
|
inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a
|
|
|
|
function! s:align()
|
|
|
|
let p = '^\s*|\s.*\s|\s*$'
|
|
|
|
if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
|
|
|
|
let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g'))
|
|
|
|
let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*'))
|
|
|
|
Tabularize/|/l1
|
|
|
|
normal! 0
|
|
|
|
call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
|
2013-11-06 18:39:35 +11:00
|
|
|
NeoBundle 'scrooloose/nerdcommenter'
|
2012-03-29 06:31:02 +11:00
|
|
|
let NERDCreateDefaultMappings = 0
|
|
|
|
let NERDSpaceDelims = 1 " space between comment and code
|
|
|
|
map // <plug>NERDCommenterToggle
|
|
|
|
vmap // <plug>NERDCommenterToggle gv
|
|
|
|
map <Leader>/ //
|
|
|
|
vmap <Leader>/ //
|
|
|
|
|
2013-11-06 18:39:35 +11:00
|
|
|
NeoBundle 'ZoomWin'
|
2012-03-29 06:31:02 +11:00
|
|
|
map <Leader>z :ZoomWin<CR>
|
|
|
|
imap <Leader>z <Esc>:ZoomWin<CR>a
|
|
|
|
|
2013-11-06 18:39:35 +11:00
|
|
|
NeoBundle 'scrooloose/nerdtree', { 'augroup' : 'NERDTreeHijackNetrw' }
|
2012-03-29 06:31:02 +11:00
|
|
|
let g:NERDTreeIgnore = ['\.rbc$', '\~$', '.DS_Store$']
|
|
|
|
let g:NERDTreeChDirMode = 2
|
|
|
|
let g:NERDTreeMouseMode = 3
|
|
|
|
let g:NERDTreeQuitOnOpen = 1
|
|
|
|
let g:NERDTreeMinimalUI = 1
|
|
|
|
let g:NERDTreeDirArrows = 1
|
|
|
|
let g:NERDTreeHijackNetrw = 0
|
|
|
|
map <Space>n :NERDTreeToggle<CR>
|
2013-11-06 18:39:35 +11:00
|
|
|
map <Leader>n :NERDTreeToggle<CR>
|
2012-08-17 08:10:05 +10:00
|
|
|
map <Leader>N :NERDTreeFind<CR>
|
2012-03-29 06:31:02 +11:00
|
|
|
|
2013-11-06 18:39:35 +11:00
|
|
|
NeoBundle 'wincent/Command-T', {
|
|
|
|
\ 'build' : {
|
|
|
|
\ 'mac' : '/usr/bin/ruby ruby/command-t/extconf.rb && make',
|
|
|
|
\ 'unix' : 'ruby ruby/command-t/extconf.rb && make'
|
|
|
|
\ }
|
|
|
|
\ }
|
2012-03-29 06:31:02 +11:00
|
|
|
let g:CommandTMaxFiles = 20000
|
|
|
|
let g:CommandTMaxHeight = 10
|
|
|
|
nnoremap <silent> <Leader>t :CommandT<CR>
|
|
|
|
nnoremap <silent> <Leader>b :CommandTBuffer<CR>
|
2012-08-17 08:10:05 +10:00
|
|
|
nnoremap <Leader>f :CommandTFlush<CR>
|
2012-03-29 06:31:02 +11:00
|
|
|
|
2013-11-06 18:39:35 +11:00
|
|
|
NeoBundle 'Indent-Guides'
|
2012-03-29 06:31:02 +11:00
|
|
|
let g:indent_guides_auto_colors = 0
|
|
|
|
let g:indent_guides_enable_on_vim_startup = 1
|
|
|
|
autocmd VimEnter * IndentGuidesEnable
|
|
|
|
autocmd FileType clojure IndentGuidesDisable
|
|
|
|
|
2013-11-06 18:39:35 +11:00
|
|
|
NeoBundle 'Syntastic'
|
2012-03-29 06:31:02 +11:00
|
|
|
let g:syntastic_enable_signs = 1
|
|
|
|
let g:syntastic_auto_loc_list = 0
|
|
|
|
let g:syntastic_disabled_filetypes = ['cucumber']
|
2011-09-21 08:26:27 +10:00
|
|
|
" }}}
|
|
|
|
|
2012-03-29 06:31:02 +11:00
|
|
|
" Other {{{
|
2013-11-06 18:39:35 +11:00
|
|
|
NeoBundle 'thisivan/vim-matchit'
|
2011-09-21 08:26:27 +10:00
|
|
|
" }}}
|
2011-12-14 10:44:35 +11:00
|
|
|
|
2012-03-29 06:31:02 +11:00
|
|
|
filetype plugin indent on
|
2013-11-06 18:39:35 +11:00
|
|
|
|
|
|
|
NeoBundleCheck
|
2012-03-29 06:31:02 +11:00
|
|
|
augroup END
|