.vimrc

changeset 603
ae87c045d04b
parent 602
2f9ceb002f74
child 604
0d7437c668d0
equal deleted inserted replaced
602:2f9ceb002f74 603:ae87c045d04b
2 " vim: fdm=marker 2 " vim: fdm=marker
3 set nocompatible 3 set nocompatible
4 4
5 " on windows and not cygwin 5 " on windows and not cygwin
6 let g:on_windows = (has('win32') || has('win64')) 6 let g:on_windows = (has('win32') || has('win64'))
7 let g:myvim = $HOME . (g:on_windows ? '/vimfiles' : '/.vim')
7 let s:filename = expand('<sfile>') 8 let s:filename = expand('<sfile>')
8 9
9 " Set up Vundle and plugins {{{ 10 " Set up Vundle and plugins {{{
10 call vimrc#VundleInstallAndBegin() 11 call vimrc#VundleInstallAndBegin()
11 12
193 set sessionoptions=buffers,curdir,localoptions 194 set sessionoptions=buffers,curdir,localoptions
194 195
195 " Enable enhanced % matching in ruby 196 " Enable enhanced % matching in ruby
196 runtime macros/matchit.vim 197 runtime macros/matchit.vim
197 198
198 if g:on_windows 199 for subdir in ['backup', 'tmp', 'undo']
199 let $MYVIM=$HOME.'/vimfiles' 200 if !filewritable(g:myvim . '/var/' . subdir)
200 201 call mkdir(g:myvim . '/var/' . subdir, 'p', 0700)
201 if !filewritable( $MYVIM . '/var' )
202 silent execute '!mkdir "'.$HOME.'\vimfiles\var"'
203 endif 202 endif
204 if !filewritable( $MYVIM. '/var/backup' ) 203 endfor
205 silent execute '!mkdir "'.$HOME.'\vimfiles\var\backup"' 204
206 endif 205 set backup
207 if !filewritable( $MYVIM . '/var/tmp' ) 206 let &backupdir = g:myvim . '/var/backup//,.'
208 silent execute '!mkdir "'.$HOME.'\vimfiles\var\tmp"' 207 let &directory = g:myvim . '/var/tmp//,.'
209 endif 208
210 if !filewritable( $MYVIM . '/var/undo' ) 209 if has('persistent_undo')
211 silent execute '!mkdir "'.$HOME.'\vimfiles\var\undo"' 210 set undofile
212 endif 211 let &undodir = g:myvim . '/var/undo//,.'
213
214 else
215 let $MYVIM=$HOME.'/.vim'
216
217 if !filewritable( $MYVIM . '/var/backup' )
218 silent execute '!mkdir -p "'.$MYVIM.'/var/backup"'
219 endif
220 if !filewritable( $MYVIM . '/var/tmp' )
221 silent execute '!mkdir "'.$MYVIM.'/var/tmp"'
222 endif
223 if !filewritable( $MYVIM . '/var/undo' )
224 silent execute '!mkdir "'.$MYVIM.'/var/undo"'
225 endif
226
227 endif 212 endif
228 213
229 if g:on_windows 214 if g:on_windows
230 set guifont=DejaVu_Sans_Mono:h10:cDEFAULT 215 set guifont=DejaVu_Sans_Mono:h10:cDEFAULT
231 set linespace=0 216 set linespace=0
237 222
238 set guioptions-=T "no toolbar, menu, tearoffs 223 set guioptions-=T "no toolbar, menu, tearoffs
239 set guioptions-=m 224 set guioptions-=m
240 set guioptions-=t 225 set guioptions-=t
241 226
242 set backupdir=$MYVIM/var/backup//,.
243 set directory=$MYVIM/var/tmp//,.
244
245 set backup
246 set autowriteall
247
248 if has('persistent_undo')
249 set undofile
250 set undodir=$MYVIM/var/undo//,.
251 endif
252 " }}} 227 " }}}
253 228
254 229
255 " Autocmds {{{ 230 " Autocmds {{{
256 augroup vimrc 231 augroup vimrc
363 \ 's:subroutines', 338 \ 's:subroutines',
364 \ 'x:around', 339 \ 'x:around',
365 \ 'l:aliases', 340 \ 'l:aliases',
366 \ 'd:pod:1:0', 341 \ 'd:pod:1:0',
367 \ ], 342 \ ],
368 \ 'deffile' : '$MYVIM/ctags/perl.cnf' 343 \ 'deffile' : g:myvim . '/ctags/perl.cnf'
369 \ } 344 \ }
370 345
371 let g:tagbar_type_elixir = { 346 let g:tagbar_type_elixir = {
372 \ 'ctagstype' : 'Elixir', 347 \ 'ctagstype' : 'Elixir',
373 \ 'kinds' : [ 348 \ 'kinds' : [

mercurial