From 18efda3933a867dd21df483bbfeae52231783d46 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 6 Feb 2018 11:15:01 +0800 Subject: Update --- ftplugin/crystal.vim | 17 ++++++++--------- ftplugin/elixir.vim | 4 ++++ ftplugin/mail_vifm.vim | 10 ++++++---- ftplugin/toml.vim | 2 -- 4 files changed, 18 insertions(+), 15 deletions(-) (limited to 'ftplugin') 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() 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() +command! -buffer -nargs=* -bar CrystalFormat call crystal_lang#format(, 0) -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 +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 + autocmd BufWritePre 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 -" 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 a :call AddMailAttacments() +nnoremap a :call AddMailAttachments() " 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 -- cgit v1.2.3