From 44b3d860cb85ccb4edd52fb0dcf6a4102d12e82a Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 31 May 2016 01:53:12 +0200 Subject: Update --- ftplugin/crystal.vim | 24 ++++++++++++++++++++++++ ftplugin/javascript.vim | 3 +++ ftplugin/slim.vim | 12 ++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 ftplugin/slim.vim (limited to 'ftplugin') diff --git a/ftplugin/crystal.vim b/ftplugin/crystal.vim index f990a8da..29aac72d 100644 --- a/ftplugin/crystal.vim +++ b/ftplugin/crystal.vim @@ -40,6 +40,30 @@ setlocal errorformat= \%C%p^, \%-C%.%# +let g:crystal_compiler_command = get(g:, 'crystal_compiler_command', 'crystal') +let g:crystal_auto_format = get(g:, 'crystal_auto_format', 0) + +command! -buffer -nargs=* CrystalImpl echo crystal_lang#impl(expand('%'), getpos('.'), ).output +command! -buffer -nargs=0 CrystalDef call crystal_lang#jump_to_definition(expand('%'), getpos('.')) +command! -buffer -nargs=* CrystalContext echo crystal_lang#context(expand('%'), getpos('.'), ).output +command! -buffer -nargs=* CrystalHierarchy echo crystal_lang#type_hierarchy(expand('%'), ) +command! -buffer -nargs=? CrystalSpecSwitch call crystal_lang#switch_spec_file() +command! -buffer -nargs=? CrystalSpecRunAll call crystal_lang#run_all_spec() +command! -buffer -nargs=? CrystalSpecRunCurrent call crystal_lang#run_current_spec() +command! -buffer -nargs=* -bar CrystalFormat call crystal_lang#format() + +nnoremap (crystal-jump-to-definition) :CrystalDef +nnoremap (crystal-show-context) :CrystalContext +nnoremap (crystal-spec-switch) :CrystalSpecSwitch +nnoremap (crystal-spec-run-all) :CrystalSpecRunAll +nnoremap (crystal-spec-run-current) :CrystalSpecRunCurrent +nnoremap (crystal-format) :CrystalFormat + +augroup plugin-ft-crystal + autocmd! + autocmd BufWritePre if g:crystal_auto_format | CrystalFormat | endif +augroup END + if get(g:, 'crystal_define_mappings', 1) nmap gd (crystal-jump-to-definition) nmap gc (crystal-show-context) diff --git a/ftplugin/javascript.vim b/ftplugin/javascript.vim index f89932f2..2b085bc1 100644 --- a/ftplugin/javascript.vim +++ b/ftplugin/javascript.vim @@ -1,5 +1,8 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1 setlocal suffixesadd+=.js +if (v:version < 704 || (v:version == 704 && !has('patch002'))) && exists('®expengine') + set re=1 +end endif diff --git a/ftplugin/slim.vim b/ftplugin/slim.vim new file mode 100644 index 00000000..b3c71187 --- /dev/null +++ b/ftplugin/slim.vim @@ -0,0 +1,12 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'slim') == -1 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let b:undo_ftplugin = "setl isk<" + +setlocal iskeyword+=- + +endif -- cgit v1.2.3