added format on write

This commit is contained in:
Talha Qamar 2024-09-29 23:27:26 +05:00
parent 489e3522d7
commit 46b7b8db45

View file

@ -1 +1,16 @@
setlocal commentstring=//\ %s
function Hbformat()
silent! !hbc --fmt-stdout <afile>
if v:shell_error
echom "Errors in file"
!hbc --fmt-stdout <afile>
else
silent! %!hbc --fmt-stdout <afile>
endif
endfunction
augroup hblang_group
autocmd!
autocmd BufWritePost *.hb :call Hbformat()
augroup END