.vimrc

changeset 368
91d4fb4e0a42
parent 362
7c5b0e94b399
child 369
9b89f81c644b
equal deleted inserted replaced
367:a9ef42db273e 368:91d4fb4e0a42
171 171
172 " K: doc, gK: Doc w/o using syntax hints, gKK: doc current filename 172 " K: doc, gK: Doc w/o using syntax hints, gKK: doc current filename
173 nmap K :call ViewDoc('doc', '<cword>')<CR> 173 nmap K :call ViewDoc('doc', '<cword>')<CR>
174 nmap gK :call ViewDoc('doc', expand('<cword>'))<CR> 174 nmap gK :call ViewDoc('doc', expand('<cword>'))<CR>
175 nmap gKK :call ViewDoc('doc', expand('%'))<CR> 175 nmap gKK :call ViewDoc('doc', expand('%'))<CR>
176
177
178 function! AutoFmtToggle()
179 if &formatoptions =~ 'a'
180 setl fo-=a
181 echo '-a'
182 else
183 setl fo+=a
184 echo '+a'
185 endif
186 endfunction
187
188 map <silent> <leader>a :call AutoFmtToggle()<CR>
176 "}}} 189 "}}}
177 190
178 191
179 " General settings {{{ 192 " General settings {{{
180 syntax on 193 syntax on
202 set autoindent 215 set autoindent
203 set expandtab 216 set expandtab
204 set shiftwidth=2 217 set shiftwidth=2
205 set softtabstop=2 218 set softtabstop=2
206 219
220 set formatoptions=cqljn1
207 set backspace=indent,eol,start 221 set backspace=indent,eol,start
208 222
209 " set number 223 " set number
210 set scrolloff=10 224 set scrolloff=10
211 set ruler 225 set ruler
300 augroup vimrc 314 augroup vimrc
301 autocmd! 315 autocmd!
302 316
303 autocmd FocusLost * silent! wa 317 autocmd FocusLost * silent! wa
304 318
305 " you have to go out of your way to make this stick
306 autocmd BufNewFile,BufRead * setlocal formatoptions-=ro
307
308 autocmd FileType text setlocal textwidth=78
309
310 " preload templates into new buffers by file extension 319 " preload templates into new buffers by file extension
311 "autocmd BufNewFile * silent! 0r $MYVIM/templates/%:e.template 320 "autocmd BufNewFile * silent! 0r $MYVIM/templates/%:e.template
321
322 " double-click to edit
323 autocmd FileType vimfiler nmap <buffer> <2-LeftMouse> <Plug>(vimfiler_edit_file)
312 324
313 " Set file marks by "category" on switch-away 325 " Set file marks by "category" on switch-away
314 autocmd BufLeave *.css,*,less,*.scss normal! mC 326 autocmd BufLeave *.css,*,less,*.scss normal! mC
315 autocmd BufLeave *.html,*.ep,*.tt normal! mH 327 autocmd BufLeave *.html,*.ep,*.tt normal! mH
316 autocmd BufLeave *.js normal! mJ 328 autocmd BufLeave *.js normal! mJ
384 let g:unite_source_grep_recursive_opt = '' 396 let g:unite_source_grep_recursive_opt = ''
385 endif 397 endif
386 398
387 ">> vimfiler 399 ">> vimfiler
388 let g:vimfiler_as_default_explorer = 1 400 let g:vimfiler_as_default_explorer = 1
389 " double-click to edit
390 autocmd FileType vimfiler nmap <buffer> <2-LeftMouse> <Plug>(vimfiler_edit_file)
391 401
392 402
393 ">> Airline 403 ">> Airline
394 let g:airline#extensions#whitespace#enabled = 0 404 let g:airline#extensions#whitespace#enabled = 0
395 let g:airline_powerline_fonts = 0 405 let g:airline_powerline_fonts = 0

mercurial