diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2018-02-06 11:15:01 +0800 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2018-02-06 11:15:01 +0800 |
commit | 18efda3933a867dd21df483bbfeae52231783d46 (patch) | |
tree | a2af3be10f2140314656d1c2e0e53ef1a1c1b6c6 /ftplugin | |
parent | bfc6ed9fbafc0758aaab228df70a3656368d8497 (diff) | |
download | vim-polyglot-18efda3933a867dd21df483bbfeae52231783d46.tar.gz vim-polyglot-18efda3933a867dd21df483bbfeae52231783d46.zip |
Update
Diffstat (limited to 'ftplugin')
-rw-r--r-- | ftplugin/crystal.vim | 17 | ||||
-rw-r--r-- | ftplugin/elixir.vim | 4 | ||||
-rw-r--r-- | ftplugin/mail_vifm.vim | 10 | ||||
-rw-r--r-- | ftplugin/toml.vim | 2 |
4 files changed, 18 insertions, 15 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) diff --git a/ftplugin/elixir.vim b/ftplugin/elixir.vim index 7219cb95..c02bff35 100644 --- a/ftplugin/elixir.vim +++ b/ftplugin/elixir.vim @@ -32,6 +32,10 @@ let &l:path = setlocal includeexpr=elixir#util#get_filename(v:fname) setlocal suffixesadd=.ex,.exs,.eex,.erl,.yrl,.hrl +if empty(&formatprg) + setlocal formatprg=mix\ format\ - +endif + let &l:define = 'def\(macro|guard|delegate\)p' silent! setlocal formatoptions-=t formatoptions+=croqlj diff --git a/ftplugin/mail_vifm.vim b/ftplugin/mail_vifm.vim index 9d6ffb68..9348b19a 100644 --- a/ftplugin/mail_vifm.vim +++ b/ftplugin/mail_vifm.vim @@ -2,11 +2,13 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vifm') == -1 " Mail file type extension to pick files for attachments via vifm " Maintainer: xaizek <xaizek@posteo.net> -" Last Change: January 01, 2018 +" Last Change: January 02, 2018 " Insert attachment picked via vifm after 'Subject' header -function! s:AddMailAttacments() - " TODO: reduce duplication between this file and plugins/vifm.vim +function! s:AddMailAttachments() + call vifm#globals#Init() + + " XXX: similar code is in plugins/vifm.vim, but it's different in details let l:listf = tempname() if !has('nvim') @@ -59,7 +61,7 @@ function! s:HandleRunResults(exitcode, listf) call delete(a:listf) endfunction -nnoremap <buffer> <silent> <localleader>a :call <sid>AddMailAttacments()<cr> +nnoremap <buffer> <silent> <localleader>a :call <sid>AddMailAttachments()<cr> " vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : diff --git a/ftplugin/toml.vim b/ftplugin/toml.vim index 1d11c9d8..baa19ba1 100644 --- a/ftplugin/toml.vim +++ b/ftplugin/toml.vim @@ -31,8 +31,6 @@ else endif unlet s:delims -let b:undo_ftplugin = "" - let &cpo = s:save_cpo unlet s:save_cpo |