2011-09-21 08:26:27 +10:00
|
|
|
filetype off
|
|
|
|
|
|
|
|
set rtp+=~/.vim/bundle/vundle/
|
|
|
|
call vundle#rc()
|
|
|
|
|
|
|
|
" Let Vundle manage Vundle
|
|
|
|
Bundle 'gmarik/vundle'
|
|
|
|
|
|
|
|
" Experimenting
|
|
|
|
Bundle 'robgleeson/hammer.vim'
|
|
|
|
let g:HammerQuiet = 1
|
|
|
|
|
|
|
|
" Languages/Syntaxes/Frameworks {{{
|
|
|
|
" Ruby {{{
|
|
|
|
Bundle 'vim-ruby/vim-ruby'
|
|
|
|
Bundle 'tpope/vim-endwise'
|
|
|
|
Bundle 'tpope/vim-rake'
|
|
|
|
Bundle 'tpope/vim-haml'
|
2011-11-08 06:28:00 +11:00
|
|
|
Bundle 'ecomba/vim-ruby-refactoring'
|
2011-10-24 11:01:15 +11:00
|
|
|
|
2011-11-15 07:19:10 +11:00
|
|
|
" " temporarily disable due to speed issues
|
|
|
|
" " see: https://github.com/tpope/vim-bundler/issues/4
|
2011-10-24 11:01:15 +11:00
|
|
|
" Bundle 'tpope/vim-bundler'
|
2011-11-15 07:19:10 +11:00
|
|
|
"
|
|
|
|
" " Also this:
|
|
|
|
" Bundle 'tpope/vim-rails'
|
2011-09-21 08:26:27 +10:00
|
|
|
" }}}
|
|
|
|
|
|
|
|
" Markdown/Textile/etc {{{
|
|
|
|
Bundle 'tpope/vim-markdown'
|
|
|
|
" }}}
|
|
|
|
|
|
|
|
" Other {{{
|
|
|
|
Bundle 'tpope/vim-cucumber'
|
2011-12-05 05:32:45 +11:00
|
|
|
" Bundle 'ap/vim-css-color'
|
2011-09-21 08:26:27 +10:00
|
|
|
Bundle 'kchmck/vim-coffee-script'
|
2011-11-04 03:37:31 +11:00
|
|
|
Bundle 'pangloss/vim-javascript'
|
2011-11-08 17:26:20 +11:00
|
|
|
Bundle 'css3'
|
|
|
|
Bundle 'othree/html5-syntax.vim'
|
|
|
|
Bundle 'tyok/js-mask'
|
|
|
|
Bundle 'AnsiEsc.vim'
|
|
|
|
Bundle 'mhz/vim-matchit'
|
2011-11-15 07:19:10 +11:00
|
|
|
|
2011-09-21 08:26:27 +10:00
|
|
|
" }}}
|
|
|
|
" }}}
|
|
|
|
|
|
|
|
" Git {{{
|
|
|
|
Bundle 'tpope/vim-fugitive'
|
|
|
|
Bundle 'tpope/vim-git'
|
2011-10-19 14:37:32 +11:00
|
|
|
Bundle 'tjennings/git-grep-vim'
|
2011-09-21 08:26:27 +10:00
|
|
|
" }}}
|
|
|
|
|
2011-10-19 15:32:00 +11:00
|
|
|
" Text objects {{{
|
|
|
|
Bundle 'kana/vim-textobj-user'
|
|
|
|
Bundle 'nelstrom/vim-textobj-rubyblock'
|
|
|
|
Bundle 'michaeljsmith/vim-indent-object'
|
|
|
|
Bundle 'argtextobj.vim'
|
|
|
|
" }}}
|
|
|
|
|
2011-09-21 08:26:27 +10:00
|
|
|
" Utility {{{
|
2011-10-24 11:01:15 +11:00
|
|
|
|
2011-11-16 05:27:34 +11:00
|
|
|
Bundle 'spiiph/vim-space'
|
2011-11-08 06:28:00 +11:00
|
|
|
Bundle 'tpope/vim-surround'
|
|
|
|
Bundle 'Raimondi/delimitMate'
|
2011-11-24 01:34:37 +11:00
|
|
|
|
2011-11-08 06:28:00 +11:00
|
|
|
Bundle 'ShowMarks7'
|
2011-11-24 01:34:37 +11:00
|
|
|
let g:showmarks_enable=0
|
2011-10-19 14:37:32 +11:00
|
|
|
|
2011-11-16 05:27:34 +11:00
|
|
|
Bundle 'YankRing.vim'
|
|
|
|
nnoremap <silent> ,y :YRShow<CR>
|
|
|
|
|
|
|
|
Bundle 'AutoComplPop'
|
|
|
|
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'
|
|
|
|
\ ]
|
|
|
|
|
|
|
|
" only enable if a filetype is set
|
|
|
|
let g:acp_enableAtStartup = 0
|
|
|
|
autocmd FileType * AcpEnable
|
|
|
|
|
2011-11-15 07:19:10 +11:00
|
|
|
Bundle 'Lokaltog/vim-easymotion'
|
|
|
|
let g:EasyMotion_keys = "arstdhneio" " Colemak home row
|
|
|
|
|
|
|
|
|
2011-11-08 17:24:56 +11:00
|
|
|
Bundle 'millermedeiros/vim-statline'
|
|
|
|
let g:statline_syntastic = 1
|
|
|
|
let g:statline_fugitive = 1
|
|
|
|
let g:statline_rvm = 0 " TODO: how to integrate with rbenv
|
|
|
|
let g:statline_filename_relative = 1
|
|
|
|
let g:statline_trailing_space = 0 " I already auto-fix these
|
|
|
|
|
|
|
|
Bundle 'Gundo'
|
|
|
|
nnoremap <Leader>u :GundoToggle<CR>
|
|
|
|
|
2011-11-08 06:28:00 +11:00
|
|
|
Bundle 'kien/rainbow_parentheses.vim'
|
2011-10-28 02:45:30 +11:00
|
|
|
autocmd VimEnter * RainbowParenthesesToggle
|
|
|
|
autocmd Syntax * RainbowParenthesesLoadRound
|
|
|
|
autocmd Syntax * RainbowParenthesesLoadSquare
|
|
|
|
autocmd Syntax * RainbowParenthesesLoadBraces
|
2011-10-27 09:41:55 +11:00
|
|
|
|
|
|
|
|
2011-10-19 14:37:32 +11:00
|
|
|
Bundle 'Tabular'
|
2011-10-24 11:01:44 +11:00
|
|
|
map <Leader>a= :Tabularize /=<CR>
|
|
|
|
map <Leader>a> :Tabularize /=><CR>
|
|
|
|
map <Leader>a: :Tabularize /\z:<CR>
|
2011-10-19 15:32:00 +11:00
|
|
|
|
2011-10-24 11:01:44 +11:00
|
|
|
vmap <Leader>a= :Tabularize /=<CR>gv
|
|
|
|
vmap <Leader>a> :Tabularize /=><CR>gv
|
|
|
|
vmap <Leader>a: :Tabularize /\z:<CR>gv
|
2011-10-19 15:32:00 +11:00
|
|
|
|
2011-10-24 11:01:44 +11:00
|
|
|
imap <Leader>a= <Esc>:Tabularize /=<CR>i
|
|
|
|
imap <Leader>a> <Esc>:Tabularize /=><CR>i
|
|
|
|
imap <Leader>a: <Esc>:Tabularize /\z:<CR>i
|
2011-10-19 15:32:00 +11:00
|
|
|
|
2011-11-04 03:37:31 +11:00
|
|
|
" 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
|
|
|
|
|
|
|
|
"" Assignments etc
|
|
|
|
" These need more work:
|
|
|
|
" TODO: - keep cursor position
|
|
|
|
" - don't align equals sign if inside hashrocket
|
|
|
|
" inoremap => =><Esc>:Tabularize /=> <CR>i
|
|
|
|
" inoremap = =<Esc>:Tabularize /=<CR>i
|
2011-09-21 08:26:27 +10:00
|
|
|
|
|
|
|
Bundle 'scrooloose/nerdcommenter'
|
|
|
|
let NERDSpaceDelims = 1 " space between comment and code
|
2011-10-24 11:01:54 +11:00
|
|
|
map // <plug>NERDCommenterToggle
|
|
|
|
vmap // <plug>NERDCommenterToggle gv
|
|
|
|
map <Leader>/ //
|
|
|
|
vmap <Leader>/ //
|
2011-09-21 08:26:27 +10:00
|
|
|
|
|
|
|
Bundle 'ZoomWin'
|
|
|
|
map <Leader>z :ZoomWin<CR>
|
|
|
|
imap <Leader>z <Esc>:ZoomWin<CR>
|
|
|
|
|
|
|
|
Bundle 'vimwiki'
|
|
|
|
let g:vimwiki_hl_cb_checked = 1
|
|
|
|
let g:vimwiki_menu = 'Plugin.Vimwiki'
|
|
|
|
let g:vimwiki_badsyms = ' '
|
|
|
|
let g:vimwiki_use_mouse = 1
|
|
|
|
let g:vimwiki_dir_link = 'index'
|
|
|
|
let g:vimwiki_list = [
|
|
|
|
\ {
|
|
|
|
\ 'path': '~/Dropbox/Wiki/Text',
|
|
|
|
\ 'path_html': '~/Dropbox/Wiki/HTML',
|
|
|
|
\ 'nested_syntaxes': {
|
|
|
|
\ 'ruby': 'ruby'
|
|
|
|
\ }
|
|
|
|
\ }
|
|
|
|
\]
|
|
|
|
|
|
|
|
Bundle 'scrooloose/nerdtree'
|
2011-10-24 14:15:57 +11:00
|
|
|
let g:NERDTreeIgnore = ['\.rbc$', '\~$', '.DS_Store$']
|
2011-10-21 02:47:30 +11:00
|
|
|
let g:NERDTreeChDirMode = 2
|
|
|
|
let g:NERDTreeMouseMode = 3
|
|
|
|
let g:NERDTreeQuitOnOpen = 1
|
|
|
|
let g:NERDTreeMinimalUI = 1
|
|
|
|
let g:NERDTreeDirArrows = 1
|
|
|
|
let g:NERDTreeHijackNetrw = 0
|
2011-09-21 08:26:27 +10:00
|
|
|
map <Leader>n :NERDTreeToggle<CR>
|
|
|
|
|
|
|
|
Bundle 'Command-T'
|
|
|
|
let g:CommandTMaxFiles = 20000
|
|
|
|
let g:CommandTMaxHeight = 10
|
|
|
|
|
|
|
|
Bundle 'Indent-Guides'
|
2011-10-24 11:02:56 +11:00
|
|
|
let g:indent_guides_auto_colors = 0
|
|
|
|
let g:indent_guides_enable_on_vim_startup = 1
|
2011-10-28 02:45:30 +11:00
|
|
|
autocmd VimEnter * IndentGuidesEnable
|
2011-09-21 08:26:27 +10:00
|
|
|
|
|
|
|
Bundle 'Syntastic'
|
2011-11-28 04:51:11 +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
|
|
|
" }}}
|
|
|
|
|
2011-10-28 02:45:30 +11:00
|
|
|
autocmd BufWritePost bundles.vim source ~/.vim/bundles.vim
|
2011-09-21 08:26:27 +10:00
|
|
|
filetype plugin indent on
|
|
|
|
|