diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2022-10-14 17:40:10 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2022-10-14 17:40:10 +0200 |
commit | bc8a81d3592dab86334f27d1d43c080ebf680d42 (patch) | |
tree | f367857d8c196d36f2d6dec3c2f6c9d703b06b7c /ftplugin/erlang.vim | |
parent | 38282d58387cff48ac203f6912c05e4c8686141b (diff) | |
download | vim-polyglot-bc8a81d3592dab86334f27d1d43c080ebf680d42.tar.gz vim-polyglot-bc8a81d3592dab86334f27d1d43c080ebf680d42.zip |
Update
Diffstat (limited to 'ftplugin/erlang.vim')
-rw-r--r-- | ftplugin/erlang.vim | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/ftplugin/erlang.vim b/ftplugin/erlang.vim index 85f57209..d9a7eaeb 100644 --- a/ftplugin/erlang.vim +++ b/ftplugin/erlang.vim @@ -9,7 +9,8 @@ endif " Contributors: Ricardo Catalinas Jiménez <jimenezrick@gmail.com> " Eduardo Lopez (http://github.com/tapichu) " Arvid Bjurklint (http://github.com/slarwise) -" Last Update: 2021-Jan-08 +" Paweł Zacharek (http://github.com/subc2) +" Last Update: 2022-Sep-28 " License: Vim license " URL: https://github.com/vim-erlang/vim-erlang-runtime @@ -61,7 +62,7 @@ setlocal suffixesadd=.erl,.hrl let &l:include = '^\s*-\%(include\|include_lib\)\s*("\zs\f*\ze")' let &l:define = '^\s*-\%(define\|record\|type\|opaque\)' -let s:erlang_fun_begin = '^\a\w*(.*$' +let s:erlang_fun_begin = '^\l[A-Za-z0-9_@]*(.*$' let s:erlang_fun_end = '^[^%]*\.\s*\(%.*\)\?$' if !exists('*GetErlangFold') @@ -103,6 +104,23 @@ let b:undo_ftplugin = "setlocal keywordprg< foldmethod< foldexpr< foldtext<" \ . " comments< commentstring< formatoptions< suffixesadd< include<" \ . " define<" +" The following lines enable the macros/matchit.vim plugin for +" extended matching with the % key. +if exists("loaded_matchit") + let s:sw = &sw + if exists('*shiftwidth') + let s:sw = shiftwidth() + endif + + let b:match_words = + \ '\<\%(begin\|case\|fun\|if\|maybe\|receive\|try\)\>' . + \ ':\<\%(after\|catch\|else\|of\)\>' . + \ ':\<end\>,' . + \ '^\l[A-Za-z0-9_@]*' . + \ ':^\%(\%(\t\| \{' . s:sw . '}\)\%([^\t\ %][^%]*\)\?\)\?;\s*\%(%.*\)\?$\|\.[\t\ %]\|\.$' + let b:match_skip = 's:comment\|string\|erlangmodifier\|erlangquotedatom' +endif + let &cpo = s:cpo_save unlet s:cpo_save |