-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
executable file
·301 lines (216 loc) · 5.64 KB
/
vimrc
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
" My Bundles here:
"
" original repos on github
Bundle 'mileszs/ack.vim'
Bundle 'kien/ctrlp.vim'
Bundle 'Raimondi/delimitMate'
Bundle 'sjl/gundo.vim'
Bundle 'juvenn/mustache.vim'
Bundle 'scrooloose/nerdcommenter'
"Bundle 'scrooloose/nerdtree'
Bundle 'nanki/treetop.vim'
Bundle 'kchmck/vim-coffee-script'
Bundle 'tpope/vim-endwise'
Bundle 'tpope/vim-fugitive'
Bundle 'pangloss/vim-javascript'
Bundle 'tpope/vim-rails'
Bundle 'vim-ruby/vim-ruby'
Bundle 'henrik/vim-ruby-runner'
Bundle 'wavded/vim-stylus'
Bundle 'tpope/vim-surround'
Bundle 'ervandew/supertab'
Bundle 'nathanaelkane/vim-indent-guides'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'vim-scripts/camelcasemotion'
Bundle 'elzr/vim-json'
Bundle 'thoughtbot/vim-rspec'
Bundle 'mattn/gist-vim'
Bundle 'scrooloose/syntastic'
Bundle 'sickill/vim-pasta'
Bundle 'tpope/vim-vinegar'
Bundle 'endel/vim-github-colorscheme'
Bundle 'tpope/vim-dispatch'
Bundle 'mattn/webapi-vim'
Bundle 'MartinLafreniere/vim-PairTools'
Bundle 'StanAngeloff/php.vim'
Bundle 'groenewege/vim-less'
Bundle 'tpope/vim-sleuth'
Bundle 'luochen1990/rainbow'
filetype plugin on
filetype indent on
set encoding=utf-8
set modelines=0
set autoindent
set showmode
set ttyfast
set ruler
set scrolloff=3
set nonumber
set hidden
set columns=9999
set laststatus=2
set nowrap
let mapleader=" "
" no backups
set nobackup
set nowritebackup
set noswapfile
" wildmenu
set wildmenu
set wildmode=list:longest
" two-spaces tab
set sw=2 sts=2 et
silent autocmd FileType
" searching
nnoremap / /\v
vnoremap / /\v
set ignorecase
set smartcase
set incsearch
set showmatch
set nohlsearch
nnoremap <leader><space> :noh<cr>*/
noremap <silent><C-h> :nohls<CR>
set completeopt=longest,menuone
" Move text, but keep highlight
vnoremap > ><CR>gv
vnoremap < <<CR>gv
"
" Y like other capitals
map Y y$
" esc replacement
inoremap jk <esc>
inoremap kj <esc>
" save on lost focus
:au FocusLost * silent! wa
" nerdtree
nnoremap <leader>n :NERDTreeToggle<CR>
nnoremap <leader>r :NERDTreeFind<CR>
" easymotion
let g:EasyMotion_leader_key = '\'
" delimitmate
let delimitMate_expand_cr = 1
let delimitMate_expand_space = 1
set wildignore+=*/tmp/*,*.so,*.swp,*.zip
"
" solarized theme
" let g:solarized_termcolors=256
syntax enable
colorscheme solarized
set background=dark
" graphical
if has('gui_running')
set guioptions-=m "remove menu bar
set guioptions-=T "remove toolbar
set guioptions-=r "remove right-hand scroll bar
set guioptions-=L "remove left-hand scroll bar
set guioptions-=e "ascii tabs
set fuoptions=maxvert,background:Normal
map <Leader>f :set invfullscreen<CR>
set vb
" fullscreen
set fu
endif
" tmp files
set dir=~/.vimtmp//,/tmp//
" gundo
"
nnoremap <Leader>u :GundoToggle<CR>
" sparkup
augroup sparkup_types
" Remove ALL autocommands of the current group.
autocmd!
" Add sparkup to new filetypes
autocmd FileType mustache,handlebars,php,htmldjango runtime! ftplugin/html/sparkup.vim
augroup END
" window navigation
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" turn off cursor blinking
set guicursor+=a:blinkon0
" copy file path to clipboard
nmap <Leader>c :let @+ = expand("%")<CR>
" autoreload changed files
set autoread
" thin line on vertical split
set fillchars=vert:\│
" don't show ~ on empty lines
hi NonText guifg=bg
" don't show current mode
set noshowmode
" statusline customization
set statusline=%f%=%F
" ctrlp
let g:ctrlp_cmd = 'CtrlPBuffer'
nmap <Leader>p :CtrlP<CR>
let g:ctrlp_regexp = 0
nmap <Tab> :CtrlPMRUFile<CR>
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn|svg|eot|woff|ttf)$'
" MatchParen caused micro slowdowns
let loaded_matchparen = 1
" Syntax coloring lines that are too long just slows down the world
set synmaxcol=256
" turn off folding
" set nofoldenable
" folding settings
set foldtext='➫'
highlight Folded gui=none guibg=#002b36
highlight FoldColumn gui=none
" long comments autofolding
"autocmd FileType ruby,eruby
"\ set foldmethod=expr |
"\ set foldexpr=getline(v:lnum)=~'^\\s*#'
" turn of ex mode
nnoremap Q <nop>
" pairtools
" Enable modules
let g:pairtools_php_pairclamp=1
let g:pairtools_php_tagwrench=1
let g:pairtools_php_jigsaw=1
" Configure PairClamp
let g:pairtools_php_autoclose=1
let g:pairtools_php_forcepairs=0
let g:pairtools_php_closepairs='(:),[:],{:},":"' . ",':'"
let g:pairtools_php_smartclose=0
let g:pairtools_php_smartcloserules='\w'
let g:pairtools_php_apostrophe=0
let g:pairtools_php_antimagic=0
let g:pairtools_php_antimagicfield="Comment,String"
let g:pairtools_php_pcexpander=1
let g:pairtools_php_pceraser=1
" Configure TagWrench
let g:pairtools_php_tagwrenchhook='tagwrench#BuiltinHTML5Hook'
let g:pairtools_php_twexpander=1
let g:pairtools_php_tweraser=1
" syntastic
let g:syntastic_mode_map = {
\ "mode": "active",
\ "active_filetypes": ["ruby"],
\ "passive_filetypes": ["javascript", "haml"] }
map <Leader>s :call SyntasticCheck()<CR>
" silver searcher
Plugin 'rking/ag.vim'
if executable('ag')
" Use ag over grep
set grepprg=ag\ --nogroup\ --nocolor
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
" ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
endif
" whitespace
Bundle 'ntpeters/vim-better-whitespace'
autocmd FileType ruby,eruby autocmd BufWritePre <buffer> StripWhitespace
" colorschemes
Plugin 'flazz/vim-colorschemes'
" rubocop
Plugin 'ngmy/vim-rubocop'