comparison runtime/ftplugin/mf.vim @ 10261:bdd7fc1a38c0

commit https://github.com/vim/vim/commit/dc08328821a2c11e33dfb1980332e4923ec64fca Author: Bram Moolenaar <Bram@vim.org> Date: Tue Oct 11 08:57:33 2016 +0200 Updated runtime files.
author Christian Brabandt <cb@256bit.org>
date Wed, 12 Oct 2016 12:15:04 +0200
parents 876fbdd84e52
children 2acb87ee55fc
comparison
equal deleted inserted replaced
10260:2fff06882079 10261:bdd7fc1a38c0
1 " Vim filetype plugin file 1 " Vim filetype plugin file
2 " Language: METAFONT 2 " Language: METAFONT
3 " Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com> 3 " Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
4 " Former Maintainers: Nikolai Weibull <now@bitwi.se> 4 " Former Maintainers: Nikolai Weibull <now@bitwi.se>
5 " Latest Revision: 2016 Oct 1 5 " Latest Revision: 2016 Oct 2
6 6
7 if exists("b:did_ftplugin") 7 if exists("b:did_ftplugin")
8 finish 8 finish
9 endif 9 endif
10 let b:did_ftplugin = 1 10 let b:did_ftplugin = 1
23 let g:omni_syntax_group_include_mf = 'mf\w\+' 23 let g:omni_syntax_group_include_mf = 'mf\w\+'
24 let g:omni_syntax_group_exclude_mf = 'mfTodoComment' 24 let g:omni_syntax_group_exclude_mf = 'mfTodoComment'
25 25
26 let s:mp_regex = { 26 let s:mp_regex = {
27 \ 'beginsection' : '^\s*\%(\%(\|var\|primary\|secondary\|tertiary\)def\|beginchar\|beginlogochar\)\>', 27 \ 'beginsection' : '^\s*\%(\%(\|var\|primary\|secondary\|tertiary\)def\|beginchar\|beginlogochar\)\>',
28 \ 'endsection' : '^\s*\%(enddef\|endchar\|endlogochar\)\>', 28 \ 'endsection' : '^\s*\%(enddef\|endchar\)\>',
29 \ 'beginblock' : '^\s*\%(begingroup\|if\|for\%(\|suffixes\|ever\)\)\>', 29 \ 'beginblock' : '^\s*\%(begingroup\|if\|for\%(\|suffixes\|ever\)\)\>',
30 \ 'endblock' : '^\s*\%(endgroup\|fi\|endfor\)\>' 30 \ 'endblock' : '^\s*\%(endgroup\|fi\|endfor\)\>'
31 \ } 31 \ }
32 32
33 function! s:move_around(count, what, flags, visual) 33 function! s:move_around(count, what, flags, visual)
34 if a:visual 34 if a:visual
35 exe "normal! gv" 35 exe "normal! gv"
36 endif 36 endif
37 call search(s:mp_regex[a:what], a:flags.'s') " 's' sets previous context mark 37 call search(s:mp_regex[a:what], a:flags.'s') " 's' sets previous context mark
38 for i in range(2, a:count) 38 call map(range(2, a:count), 'search(s:mp_regex[a:what], a:flags)')
39 call search(s:mp_regex[a:what], a:flags)
40 endfor
41 endfunction 39 endfunction
42 40
43 41
44 " Move around macros. 42 " Move around macros.
45 nnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:false) <CR> 43 nnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:false) <CR>
60 let b:match_words = 58 let b:match_words =
61 \ '\<if\>:\<else\%[if]\>:\<fi\>,' . 59 \ '\<if\>:\<else\%[if]\>:\<fi\>,' .
62 \ '\<for\%(\|suffixes\|ever\)\>:\<exit\%(if\|unless\)\>:\<endfor\>,' . 60 \ '\<for\%(\|suffixes\|ever\)\>:\<exit\%(if\|unless\)\>:\<endfor\>,' .
63 \ '\<\%(\|var\|primary\|secondary\|tertiary\)def\>:\<enddef\>,' . 61 \ '\<\%(\|var\|primary\|secondary\|tertiary\)def\>:\<enddef\>,' .
64 \ '\<begingroup\>:\<endgroup\>,' . 62 \ '\<begingroup\>:\<endgroup\>,' .
65 \ '\<beginchar\>:\<endchar\>' . 63 \ '\<begin\%(logo\)\?char\>:\<endchar\>'
66 \ '\<beginlogochar\>:\<endlogochar\>'
67 " Ignore comments and strings 64 " Ignore comments and strings
68 let b:match_skip = 'synIDattr(synID(line("."), col("."), 1), "name") 65 let b:match_skip = 'synIDattr(synID(line("."), col("."), 1), "name")
69 \ =~# "mf\\(Comment\\|String\\)$"' 66 \ =~# "mf\\(Comment\\|String\\)$"'
70 endif 67 endif
71 68