/
vimrc.bundles
157 lines (123 loc) · 4.06 KB
/
vimrc.bundles
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" Let Vundle manage Vundle
Plugin 'gmarik/vundle'
" ------------------------------
" General
" ------------------------------
Plugin 'bling/vim-airline'
Plugin 'rking/ag.vim'
Plugin 'tpope/vim-dispatch'
Plugin 'tpope/vim-endwise'
Plugin 'tpope/vim-eunuch'
Plugin 'tpope/vim-repeat'
Plugin 'tpope/vim-speeddating'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-unimpaired'
Plugin 'kien/ctrlp.vim'
let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$'
let g:ctrlp_dotfiles = 0
let g:ctrlp_max_depth = 15
let g:ctrlp_max_files = 5000
let g:ctrlp_open_multiple_files = 't'
let g:ctrlp_working_path_mode = 2
if executable('ag')
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
let g:ctrlp_use_caching = 1
endif
map <Leader>b :CtrlPBuffer<CR>
map <Leader>g :CtrlPTag<CR>
" Start CtrlP scoped to the current file's directory
map <Leader>e :CtrlP %%<cr>
" CtrlP scoped to various Rails directories
autocmd User Rails map <Leader>c :CtrlP app/controllers/<cr>
autocmd User Rails map <Leader>h :CtrlP app/helpers/<cr>
autocmd User Rails map <Leader>j :CtrlP app/assets/javascripts/<cr>
autocmd User Rails map <Leader>S :CtrlP app/assets/stylesheets/<cr>
autocmd User Rails map <Leader>m :CtrlP app/models/<cr>
autocmd User Rails map <Leader>u :CtrlP spec/models/<cr>
autocmd User Rails map <Leader>v :CtrlP app/views/<cr>
Plugin 'thoughtbot/vim-rspec'
let g:rspec_command = "compiler rspec | set makeprg=zeus | Make rspec {spec}"
map <Leader>t :call RunCurrentSpecFile()<CR>
map <Leader>n :call RunNearestSpec()<CR>
map <Leader>l :call RunLastSpec()<CR>
map <Leader>s :call RunAllSpecs()<CR>
Plugin 'AndrewRadev/switch.vim'
nnoremap - :Switch<cr>
Plugin 'Tabular'
map <Leader>a= :Tabularize /=<CR>
map <Leader>a> :Tabularize /=><CR>
map <Leader>a: :Tabularize properties<CR>
map <Leader>at :Tabularize table<CR>
map <Leader>a# :Tabularize rdoc<CR>
vmap <Leader>a= :Tabularize /=<CR>gv
vmap <Leader>a> :Tabularize /=><CR>gv
vmap <Leader>a: :Tabularize properties<CR>gv
vmap <Leader>at :Tabularize table<CR>gv
vmap <Leader>a# :Tabularize rdoc<CR>gv
Plugin 'tpope/vim-commentary'
nmap <Leader>cc gcc
vmap <Leader>cc gc
Plugin 'scrooloose/nerdtree'
let g:NERDTreeIgnore = ['\.rbc$', '\~$', '.DS_Store$']
let g:NERDTreeChDirMode = 2
let g:NERDTreeQuitOnOpen = 1
let g:NERDTreeMinimalUI = 1
let g:NERDTreeDirArrows = 0
let g:NERDTreeHijackNetrw = 1
map <Leader>/ :NERDTreeFind<CR>
autocmd WinEnter * call s:CloseIfOnlyNerdTreeLeft()
" Close all open buffers on entering a window if the only
" buffer that's left is the NERDTree buffer
function! s:CloseIfOnlyNerdTreeLeft()
if exists("t:NERDTreeBufName")
if bufwinnr(t:NERDTreeBufName) != -1
if winnr("$") == 1
q
endif
endif
endif
endfunction
" ------------------------------
" CoffeeScript / JavaScript
" ------------------------------
Plugin 'kchmck/vim-coffee-script'
" ------------------------------
" Git
" ------------------------------
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-git'
" ------------------------------
" Ruby
" ------------------------------
Plugin 'tpope/vim-cucumber'
Plugin 'tpope/vim-haml'
Plugin 'tpope/vim-rails'
Plugin 'tpope/vim-rake'
" ------------------------------
" Text objects
" ------------------------------
runtime macros/matchit.vim
Plugin 'kana/vim-textobj-user'
Plugin 'nelstrom/vim-textobj-rubyblock'
" ------------------------------
" Misc
" ------------------------------
Plugin 'nginx.vim'
Plugin 'tpope/vim-markdown'
" ------------------------------
" Colors
" ------------------------------
Plugin 'tomasr/molokai'
Plugin 'chriskempson/vim-tomorrow-theme'
Plugin 'nanotech/jellybeans.vim'
Plugin 'croaky/vim-colors-github'
" ------------------------------
" Experimental
" ------------------------------
Plugin 'AndrewRadev/splitjoin.vim'
Plugin 'jc00ke/vim-tomdoc'
filetype on