summaryrefslogtreecommitdiffstats
path: root/ftplugin
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2018-01-10 23:50:02 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2018-01-10 23:50:02 +0100
commit58709c49f6b6ede81dcf87752b09b8f64d84f1fc (patch)
tree3d9a50b80abee303e4663475b7c1e9e6fd4b7f2c /ftplugin
parent3d5b784fa59b0e70e0174174ba894054aa5b02bc (diff)
downloadvim-polyglot-58709c49f6b6ede81dcf87752b09b8f64d84f1fc.tar.gz
vim-polyglot-58709c49f6b6ede81dcf87752b09b8f64d84f1fc.zip
Update
Diffstat (limited to 'ftplugin')
-rw-r--r--ftplugin/elixir.vim25
-rw-r--r--ftplugin/mail_vifm.vim4
2 files changed, 23 insertions, 6 deletions
diff --git a/ftplugin/elixir.vim b/ftplugin/elixir.vim
index 651cfba6..7219cb95 100644
--- a/ftplugin/elixir.vim
+++ b/ftplugin/elixir.vim
@@ -1,12 +1,12 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1
-if (exists("b:did_ftplugin"))
+if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
" Matchit support
-if exists("loaded_matchit") && !exists("b:match_words")
+if exists('loaded_matchit') && !exists('b:match_words')
let b:match_ignorecase = 0
let b:match_words = '\:\@<!\<\%(do\|fn\)\:\@!\>' .
@@ -32,9 +32,26 @@ let &l:path =
setlocal includeexpr=elixir#util#get_filename(v:fname)
setlocal suffixesadd=.ex,.exs,.eex,.erl,.yrl,.hrl
+let &l:define = 'def\(macro|guard|delegate\)p'
+
+silent! setlocal formatoptions-=t formatoptions+=croqlj
+
+let b:block_begin = '\<\(do$\|fn\>\)'
+let b:block_end = '\<end\>'
+
+nnoremap <buffer> <silent> <expr> ]] ':silent keeppatterns /'.b:block_begin.'<CR>'
+nnoremap <buffer> <silent> <expr> [[ ':silent keeppatterns ?'.b:block_begin.'<CR>'
+nnoremap <buffer> <silent> <expr> ][ ':silent keeppatterns /'.b:block_end .'<CR>'
+nnoremap <buffer> <silent> <expr> [] ':silent keeppatterns ?'.b:block_end .'<CR>'
+
+onoremap <buffer> <silent> <expr> ]] ':silent keeppatterns /'.b:block_begin.'<CR>'
+onoremap <buffer> <silent> <expr> [[ ':silent keeppatterns ?'.b:block_begin.'<CR>'
+onoremap <buffer> <silent> <expr> ][ ':silent keeppatterns /'.b:block_end .'<CR>'
+onoremap <buffer> <silent> <expr> [] ':silent keeppatterns ?'.b:block_end .'<CR>'
+
silent! setlocal formatoptions-=t formatoptions+=croqlj
-let b:undo_ftplugin = 'setlocal sw< sts< et< isk< com< cms< path< inex< sua< '.
- \ '| unlet! b:match_ignorecase b:match_words'
+let b:undo_ftplugin = 'setlocal sw< sts< et< isk< com< cms< path< inex< sua< def<'.
+ \ '| unlet! b:match_ignorecase b:match_words b:block_begin b:block_end'
endif
diff --git a/ftplugin/mail_vifm.vim b/ftplugin/mail_vifm.vim
index 09cac4c6..9d6ffb68 100644
--- a/ftplugin/mail_vifm.vim
+++ b/ftplugin/mail_vifm.vim
@@ -2,7 +2,7 @@ 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 23, 2016
+" Last Change: January 01, 2018
" Insert attachment picked via vifm after 'Subject' header
function! s:AddMailAttacments()
@@ -26,7 +26,7 @@ function! s:AddMailAttacments()
else
" Work around handicapped neovim...
let callback = { 'listf': l:listf }
- function! callback.on_exit(id, code)
+ function! callback.on_exit(id, code, event)
buffer #
silent! bdelete! #
call s:HandleRunResults(a:code, self.listf)