Adds my basic setup

This commit is contained in:
zwergius 2024-01-12 17:23:52 +01:00
parent 9b256d9368
commit fd947ffd03
7 changed files with 203 additions and 11 deletions

11
auto-mkdir.vim Normal file
View file

@ -0,0 +1,11 @@
augroup vimrc-auto-mkdir
autocmd!
autocmd BufWritePre * call s:auto_mkdir(expand('<afile>:p:h'), v:cmdbang)
function! s:auto_mkdir(dir, force)
if !isdirectory(a:dir)
\ && (a:force
\ || input("'" . a:dir . "' does not exist. Create? [y/N]") =~? '^y\%[es]$')
call mkdir(iconv(a:dir, &encoding, &termencoding), 'p')
endif
endfunction
augroup END