annotate runtime/ftplugin/mf.vim @ 18788:e1f4e9d78a6a v8.1.2383

patch 8.1.2383: using old C style comments Commit: https://github.com/vim/vim/commit/734a867ffe198886da7365b618be67ab8ed9d9f6 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Dec 2 22:49:38 2019 +0100 patch 8.1.2383: using old C style comments Problem: Using old C style comments. Solution: Use // comments where appropriate.
author Bram Moolenaar <Bram@vim.org>
date Mon, 02 Dec 2019 23:00:04 +0100
parents bdd7fc1a38c0
children 2acb87ee55fc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
389
4fe8e1a7758e updated for version 7.0102
vimboss
parents: 7
diff changeset
1 " Vim filetype plugin file
10244
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
2 " Language: METAFONT
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
3 " Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
4 " Former Maintainers: Nikolai Weibull <now@bitwi.se>
10261
bdd7fc1a38c0 commit https://github.com/vim/vim/commit/dc08328821a2c11e33dfb1980332e4923ec64fca
Christian Brabandt <cb@256bit.org>
parents: 10244
diff changeset
5 " Latest Revision: 2016 Oct 2
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 if exists("b:did_ftplugin")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 let b:did_ftplugin = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 839
diff changeset
12 let s:cpo_save = &cpo
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 839
diff changeset
13 set cpo&vim
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 839
diff changeset
14
10244
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
15 let b:undo_ftplugin = "setl com< cms< fo< sua< inc< def< ofu<"
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
16 \ . "| unlet! b:match_ignorecase b:match_words b:match_skip"
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
17
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
18 setlocal comments=:% commentstring=%\ %s formatoptions-=t formatoptions+=cjroql2
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
19 setlocal suffixesadd=.mf
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
20 let &l:include = '\<input\>'
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
21 let &l:define = '\<\%(let\|newinternal\|interim\|def\|vardef\)\>\|\<\%(primary\|secondary\|tertiary\)def\>\s*[^ .]\+'
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
22 setlocal omnifunc=syntaxcomplete#Complete
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
23 let g:omni_syntax_group_include_mf = 'mf\w\+'
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
24 let g:omni_syntax_group_exclude_mf = 'mfTodoComment'
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
25
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
26 let s:mp_regex = {
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
27 \ 'beginsection' : '^\s*\%(\%(\|var\|primary\|secondary\|tertiary\)def\|beginchar\|beginlogochar\)\>',
10261
bdd7fc1a38c0 commit https://github.com/vim/vim/commit/dc08328821a2c11e33dfb1980332e4923ec64fca
Christian Brabandt <cb@256bit.org>
parents: 10244
diff changeset
28 \ 'endsection' : '^\s*\%(enddef\|endchar\)\>',
10244
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
29 \ 'beginblock' : '^\s*\%(begingroup\|if\|for\%(\|suffixes\|ever\)\)\>',
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
30 \ 'endblock' : '^\s*\%(endgroup\|fi\|endfor\)\>'
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
31 \ }
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
32
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
33 function! s:move_around(count, what, flags, visual)
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
34 if a:visual
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
35 exe "normal! gv"
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
36 endif
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
37 call search(s:mp_regex[a:what], a:flags.'s') " 's' sets previous context mark
10261
bdd7fc1a38c0 commit https://github.com/vim/vim/commit/dc08328821a2c11e33dfb1980332e4923ec64fca
Christian Brabandt <cb@256bit.org>
parents: 10244
diff changeset
38 call map(range(2, a:count), 'search(s:mp_regex[a:what], a:flags)')
10244
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
39 endfunction
389
4fe8e1a7758e updated for version 7.0102
vimboss
parents: 7
diff changeset
40
10244
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
41
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
42 " Move around macros.
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
43 nnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:false) <CR>
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
44 vnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:true) <CR>
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
45 nnoremap <silent><buffer> ]] :<C-U>call <SID>move_around(v:count1, "beginsection", "W", v:false) <CR>
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
46 vnoremap <silent><buffer> ]] :<C-U>call <SID>move_around(v:count1, "beginsection", "W", v:true) <CR>
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
47 nnoremap <silent><buffer> [] :<C-U>call <SID>move_around(v:count1, "endsection", "bW", v:false) <CR>
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
48 vnoremap <silent><buffer> [] :<C-U>call <SID>move_around(v:count1, "endsection", "bW", v:true) <CR>
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
49 nnoremap <silent><buffer> ][ :<C-U>call <SID>move_around(v:count1, "endsection", "W", v:false) <CR>
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
50 vnoremap <silent><buffer> ][ :<C-U>call <SID>move_around(v:count1, "endsection", "W", v:true) <CR>
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
51 nnoremap <silent><buffer> [{ :<C-U>call <SID>move_around(v:count1, "beginblock", "bW", v:false) <CR>
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
52 vnoremap <silent><buffer> [{ :<C-U>call <SID>move_around(v:count1, "beginblock", "bW", v:true) <CR>
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
53 nnoremap <silent><buffer> ]} :<C-U>call <SID>move_around(v:count1, "endblock", "W", v:false) <CR>
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
54 vnoremap <silent><buffer> ]} :<C-U>call <SID>move_around(v:count1, "endblock", "W", v:true) <CR>
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
55
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
56 if exists("loaded_matchit")
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
57 let b:match_ignorecase = 0
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
58 let b:match_words =
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
59 \ '\<if\>:\<else\%[if]\>:\<fi\>,' .
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
60 \ '\<for\%(\|suffixes\|ever\)\>:\<exit\%(if\|unless\)\>:\<endfor\>,' .
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
61 \ '\<\%(\|var\|primary\|secondary\|tertiary\)def\>:\<enddef\>,' .
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
62 \ '\<begingroup\>:\<endgroup\>,' .
10261
bdd7fc1a38c0 commit https://github.com/vim/vim/commit/dc08328821a2c11e33dfb1980332e4923ec64fca
Christian Brabandt <cb@256bit.org>
parents: 10244
diff changeset
63 \ '\<begin\%(logo\)\?char\>:\<endchar\>'
10244
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
64 " Ignore comments and strings
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
65 let b:match_skip = 'synIDattr(synID(line("."), col("."), 1), "name")
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
66 \ =~# "mf\\(Comment\\|String\\)$"'
876fbdd84e52 commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Christian Brabandt <cb@256bit.org>
parents: 1698
diff changeset
67 endif
389
4fe8e1a7758e updated for version 7.0102
vimboss
parents: 7
diff changeset
68
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 839
diff changeset
69 let &cpo = s:cpo_save
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 839
diff changeset
70 unlet s:cpo_save