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 |