This commit is contained in:
Adam Stankiewicz
2020-08-21 14:51:19 +02:00
parent 0df1bfa0c5
commit cf8e31ff7f
2 changed files with 3 additions and 1 deletions

View File

@@ -38,7 +38,8 @@ nnoremap <buffer><Plug>(crystal-spec-run-current) :<C-u>CrystalSpecRunCurrent<
nnoremap <buffer><Plug>(crystal-format) :<C-u>CrystalFormat<CR>
augroup plugin-ft-crystal
autocmd BufWritePre <buffer> if g:crystal_auto_format | call crystal_lang#format('', 1) | endif
autocmd!
autocmd BufWritePre <buffer> if g:crystal_auto_format && &filetype ==# 'crystal' | call crystal_lang#format('', 1) | endif
augroup END
if get(g:, 'crystal_define_mappings', 1)

View File

@@ -1,5 +1,6 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
" Filetype plugin for https://crystal-lang.org/api/0.35.1/ECR.html
if exists('b:did_ftplugin')
finish
endif