.vim/autoload/vimrc.vim

Mon, 16 Jan 2017 05:40:21 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Mon, 16 Jan 2017 05:40:21 -0500
changeset 473
049e9d356e16
parent 470
4c2db769baac
child 574
3874b97048b0
permissions
-rw-r--r--

Fix for new session while in tmux


function! vimrc#AutoFmtToggle() abort
  if &formatoptions =~ 'a'
    setl fo-=a
    echo '-a'
  else
    setl fo+=a
    echo '+a'
  endif
endfunction

" Make paths when writing, as necessary
function! vimrc#MkNonExDir(file, buf) abort
  if empty(getbufvar(a:buf, '&buftype')) && a:file!~#'\v^\w+\:\/'
    let dir=fnamemodify(a:file, ':h')
    if !isdirectory(dir)
      call mkdir(dir, 'p')
    endif
  endif
endfunction

mercurial