package publish

This commit is contained in:
Vanessa McHale 2017-12-23 15:28:28 -06:00
parent fbb73f005a
commit acf7da25e0
1 changed files with 10 additions and 0 deletions

View File

@ -3,6 +3,7 @@ if exists('b:ats_ftplugin')
endif
let b:ats_ftplugin = 1
" set config values
if !exists('g:ats_autoformat')
if executable('atsfmt') == 1
let g:ats_autoformat = 1
@ -11,12 +12,18 @@ if !exists('g:ats_autoformat')
endif
endif
" indentation rules
set smarttab
au BufNewFile,BufRead *.*ats
\ set shiftwidth=2
" set comment string to something prettier
setlocal commentstring=(*\ %s\ *)
" register patscc as a checker
let g:syntastic_ats_checkers = [ 'patscc' ]
" function to format our buffer
function! AtsFormat()
let cursor = getpos('.')
exec 'normal! gg'
@ -25,10 +32,13 @@ function! AtsFormat()
call setpos('.', cursor)
endfunction
" format on write
if g:ats_autoformat == 1
augroup ats
autocmd BufWritePost *.ats,*.dats,*.sats,*.cats call AtsFormat()
augroup END
endif
" commands
command -nargs=0 Format call AtsFormat()
command -nargs=0 Check SyntasticCheck patscc