summaryrefslogtreecommitdiffstats
path: root/ftplugin/crystal.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2018-02-06 11:15:01 +0800
committerAdam Stankiewicz <sheerun@sher.pl>2018-02-06 11:15:01 +0800
commit18efda3933a867dd21df483bbfeae52231783d46 (patch)
treea2af3be10f2140314656d1c2e0e53ef1a1c1b6c6 /ftplugin/crystal.vim
parentbfc6ed9fbafc0758aaab228df70a3656368d8497 (diff)
downloadvim-polyglot-18efda3933a867dd21df483bbfeae52231783d46.tar.gz
vim-polyglot-18efda3933a867dd21df483bbfeae52231783d46.zip
Update
Diffstat (limited to 'ftplugin/crystal.vim')
-rw-r--r--ftplugin/crystal.vim17
1 files changed, 8 insertions, 9 deletions
diff --git a/ftplugin/crystal.vim b/ftplugin/crystal.vim
index 57ceb97d..6ef907be 100644
--- a/ftplugin/crystal.vim
+++ b/ftplugin/crystal.vim
@@ -50,18 +50,17 @@ command! -buffer -nargs=* CrystalHierarchy echo crystal_lang#type_hierarchy(expa
command! -buffer -nargs=? CrystalSpecSwitch call crystal_lang#switch_spec_file(<f-args>)
command! -buffer -nargs=? CrystalSpecRunAll call crystal_lang#run_all_spec(<f-args>)
command! -buffer -nargs=? CrystalSpecRunCurrent call crystal_lang#run_current_spec(<f-args>)
-command! -buffer -nargs=* -bar CrystalFormat call crystal_lang#format(<q-args>)
+command! -buffer -nargs=* -bar CrystalFormat call crystal_lang#format(<q-args>, 0)
-nnoremap <Plug>(crystal-jump-to-definition) :<C-u>CrystalDef<CR>
-nnoremap <Plug>(crystal-show-context) :<C-u>CrystalContext<CR>
-nnoremap <Plug>(crystal-spec-switch) :<C-u>CrystalSpecSwitch<CR>
-nnoremap <Plug>(crystal-spec-run-all) :<C-u>CrystalSpecRunAll<CR>
-nnoremap <Plug>(crystal-spec-run-current) :<C-u>CrystalSpecRunCurrent<CR>
-nnoremap <Plug>(crystal-format) :<C-u>CrystalFormat<CR>
+nnoremap <buffer><Plug>(crystal-jump-to-definition) :<C-u>CrystalDef<CR>
+nnoremap <buffer><Plug>(crystal-show-context) :<C-u>CrystalContext<CR>
+nnoremap <buffer><Plug>(crystal-spec-switch) :<C-u>CrystalSpecSwitch<CR>
+nnoremap <buffer><Plug>(crystal-spec-run-all) :<C-u>CrystalSpecRunAll<CR>
+nnoremap <buffer><Plug>(crystal-spec-run-current) :<C-u>CrystalSpecRunCurrent<CR>
+nnoremap <buffer><Plug>(crystal-format) :<C-u>CrystalFormat<CR>
augroup plugin-ft-crystal
- autocmd!
- autocmd BufWritePre <buffer> if g:crystal_auto_format | CrystalFormat | endif
+ autocmd BufWritePre <buffer> if g:crystal_auto_format | call crystal_lang#format('', 1) | endif
augroup END
if get(g:, 'crystal_define_mappings', 1)