.vim/autoload/vimrc.vim

changeset 470
4c2db769baac
child 574
3874b97048b0
equal deleted inserted replaced
469:fbf39fa1349c 470:4c2db769baac
1
2 function! vimrc#AutoFmtToggle() abort
3 if &formatoptions =~ 'a'
4 setl fo-=a
5 echo '-a'
6 else
7 setl fo+=a
8 echo '+a'
9 endif
10 endfunction
11
12 " Make paths when writing, as necessary
13 function! vimrc#MkNonExDir(file, buf) abort
14 if empty(getbufvar(a:buf, '&buftype')) && a:file!~#'\v^\w+\:\/'
15 let dir=fnamemodify(a:file, ':h')
16 if !isdirectory(dir)
17 call mkdir(dir, 'p')
18 endif
19 endif
20 endfunction
21

mercurial