mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-14 06:23:50 -05:00
Add dhall, closes #426
This commit is contained in:
39
ftplugin/dhall.vim
Normal file
39
ftplugin/dhall.vim
Normal file
@@ -0,0 +1,39 @@
|
||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'dhall') != -1
|
||||
finish
|
||||
endif
|
||||
|
||||
if exists('b:dhall_ftplugin')
|
||||
finish
|
||||
endif
|
||||
let b:dhall_ftplugin = 1
|
||||
|
||||
setlocal commentstring=--\ %s
|
||||
|
||||
set smarttab
|
||||
|
||||
if exists('g:dhall_use_ctags')
|
||||
if g:dhall_use_ctags == 1
|
||||
augroup dhall
|
||||
autocmd BufWritePost *.dhall silent !ctags -R .
|
||||
augroup END
|
||||
endif
|
||||
endif
|
||||
|
||||
function! StripTrailingWhitespace()
|
||||
let myline=line('.')
|
||||
let mycolumn = col('.')
|
||||
exec 'silent %s/ *$//'
|
||||
call cursor(myline, mycolumn)
|
||||
endfunction
|
||||
|
||||
if exists('g:dhall_strip_whitespace')
|
||||
if g:dhall_strip_whitespace == 1
|
||||
augroup dhall
|
||||
au BufWritePre *.dhall silent! call StripTrailingWhitespace()
|
||||
augroup END
|
||||
endif
|
||||
endif
|
||||
|
||||
augroup dhall
|
||||
au BufNewFile,BufRead *.dhall setl shiftwidth=2
|
||||
augroup END
|
||||
Reference in New Issue
Block a user