diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2020-07-06 19:13:39 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2020-07-06 19:13:39 +0200 |
commit | 8500ae8bb9f4da69273eace4d9cef54ae7f18627 (patch) | |
tree | 85acb09cdf450251a775e23a76a42db7003303d0 /ftplugin | |
parent | d09a56a494863afd789cba1850e123dfc1dd26cf (diff) | |
download | vim-polyglot-8500ae8bb9f4da69273eace4d9cef54ae7f18627.tar.gz vim-polyglot-8500ae8bb9f4da69273eace4d9cef54ae7f18627.zip |
Update
Diffstat (limited to 'ftplugin')
-rw-r--r-- | ftplugin/crystal.vim | 55 | ||||
-rw-r--r-- | ftplugin/eruby.vim | 2 |
2 files changed, 24 insertions, 33 deletions
diff --git a/ftplugin/crystal.vim b/ftplugin/crystal.vim index 1a2b5970..f5b7e3a9 100644 --- a/ftplugin/crystal.vim +++ b/ftplugin/crystal.vim @@ -5,34 +5,6 @@ if exists('b:did_ftplugin') endif let b:did_ftplugin = 1 -" This file is loaded on 'ecrystal' filetype -if &filetype !=# 'crystal' - finish -endif - -let s:save_cpo = &cpo -set cpo&vim - -if exists('loaded_matchit') && !exists('b:match_words') - let b:match_ignorecase = 0 - - let b:match_words = - \ '\<\%(if\|unless\|case\|while\|until\|for\|do\|class\|module\|struct\|lib\|macro\|ifdef\|def\|fun\|begin\|enum\)\>=\@!' . - \ ':' . - \ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' . - \ ':' . - \ '\<end\>' . - \ ',{:},\[:\],(:)' - - let b:match_skip = - \ "synIDattr(synID(line('.'),col('.'),0),'name') =~ '" . - \ "\\<crystal\\%(String\\|StringDelimiter\\|ASCIICode\\|Escape\\|" . - \ "Interpolation\\|NoInterpolation\\|Comment\\|Documentation\\|" . - \ "ConditionalModifier\\|RepeatModifier\\|OptionalDo\\|" . - \ "Function\\|BlockArgument\\|KeywordAsMethod\\|ClassVariable\\|" . - \ "InstanceVariable\\|GlobalVariable\\|Symbol\\)\\>'" -endif - setlocal comments=:# setlocal commentstring=#\ %s setlocal suffixesadd=.cr @@ -81,14 +53,33 @@ if &l:ofu ==# '' setlocal omnifunc=crystal_lang#complete endif -if exists('AutoPairsLoaded') +" Options for vim-matchit +if exists('g:loaded_matchit') && !exists('b:match_words') + let b:match_ignorecase = 0 + + let b:match_words = + \ '\<\%(if\|unless\|case\|while\|until\|for\|do\|class\|module\|struct\|lib\|macro\|ifdef\|def\|begin\|enum\|annotation\)\>=\@!' . + \ ':' . + \ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|next\)\>' . + \ ':' . + \ '\<end\>' . + \ ',{:},\[:\],(:)' + + let b:match_skip = + \ 'synIDattr(synID(line("."), col("."), 0), "name") =~# ''' . + \ '\<crystal\%(String\|StringDelimiter\|ASCIICode\|Escape\|' . + \ 'Interpolation\|NoInterpolation\|Comment\|Documentation\|' . + \ 'ConditionalModifier\|' . + \ 'Function\|BlockArgument\|KeywordAsMethod\|ClassVariable\|' . + \ 'InstanceVariable\|GlobalVariable\|Symbol\)\>''' +endif + +" Options for jiangmiao/auto-pairs +if exists('g:AutoPairsLoaded') let b:AutoPairs = { '{%': '%}' } call extend(b:AutoPairs, g:AutoPairs, 'force') endif -let &cpo = s:save_cpo -unlet s:save_cpo - " vim: sw=2 sts=2 et: endif diff --git a/ftplugin/eruby.vim b/ftplugin/eruby.vim index 2add9e90..342283b0 100644 --- a/ftplugin/eruby.vim +++ b/ftplugin/eruby.vim @@ -119,7 +119,7 @@ endif " TODO: comments= setlocal commentstring=<%#%s%> -let b:undo_ftplugin = "setl cms< " +let b:undo_ftplugin = "setl cms< " . \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin let &cpo = s:save_cpo |