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