annotate runtime/doc/ft_mp.txt @ 32808:c5e4ab7ea905

Added tag v9.0.1719 for changeset 0582b3b40319ff2562c7f627694504f647a6d0fd
author Christian Brabandt <cb@256bit.org>
date Tue, 15 Aug 2023 23:30:04 +0200
parents cc751d944b7e
children 4635e43f2c6f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
29885
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 *ft_mp.txt* For Vim version 9.0. Last change: 2022 Aug 12
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 This is the documentation for the METAFONT and MetaPost filetype plugins.
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 Unless otherwise specified, the commands, settings and mappings defined below
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5 apply equally to both filetypes.
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 NOTE: the plugin requires +vim9script.
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9 ==============================================================================
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10 CONTENTS *mp.vim* *ft-metapost*
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 *mf.vim* *ft-metafont*
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13 1. Introduction |ft-metapost-intro|
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 2. Commands |ft-metapost-commands|
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 3. Settings |ft-metapost-settings|
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16 4. Mappings |ft-metapost-mappings|
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 ==============================================================================
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 *ft-metapost-intro*
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20 *ft-metafont-intro*
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21 Introduction ~
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 This filetype plugin provides extensive support for editing METAFONT and
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 MetaPost documents, including syntax coloring, indentation, and completion.
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 Defining indentation rules for METAFONT and MetaPost code is tricky and
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 somewhat subjective, because the syntax is quite liberal. The plugin uses some
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 heuristics that work well most of the time, but in particular cases you may
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 want to to override the automatic rules, so that the manually defined
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 indentation is preserved by commands like `gg=G`.
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 This can be achieved by appending `%>`, `%<`, `%=` or `%!` to a line to
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 explicitly control the indentation of the next line. The `<` and `>` symbols
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 may be repeated many times: for instance, `%>>` will cause the next line to be
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 indented twice. Of course, `%<` means that the next line should be
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 de-indented; `%=` sets the indentation of the next line to be equal to the
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36 indentation of the current line; and `%!` means that the indentation of the
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 next line should not change from whatever it has been manually set.
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39 For example, this is the default indentation of a simple macro:
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40 >
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
41 def foo =
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42 makepen(
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43 subpath(T-n,t) of r
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44 shifted .5down
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45 --subpath(t,T) of r shifted .5up -- cycle
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46 )
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47 withcolor black
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48 enddef
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49 <
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 By adding the special comments, the indentation can be adjusted arbitrarily:
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
51 >
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52 def foo =
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53 makepen(
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54 subpath(T-n,t) of r %>
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55 shifted .5down %>
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56 --subpath(t,T) of r shifted .5up -- cycle %<<<
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
57 )
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
58 withcolor black
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
59 enddef
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
60 <
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
61 *ft-metapost-commands*
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
62 Commands ~
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
63 *:FixBeginfigs*
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
64 Renumber beginfig() blocks in the current buffer so that the n-th figure has
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
65 number n. MetaPost only.
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
66
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
67 *ft-metapost-settings*
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
68 *ft-metafont-settings*
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
69 Settings ~
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
70 *'g:mf_other_macros'*
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
71 Highlight some other basic macro names, e.g., from cmbase, logo, etc. This is
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
72 set to 1 by default in METAFONT buffers, and it is set to 0 by default in
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
73 MetaPost buffers.
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
74
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
75 *'g:mf_plain_macros'*
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
76 Highlight keywords defined by plain.mf. This is set to 1 by default in
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
77 METAFONT buffers, and it is set to 0 by default in MetaPost buffers.
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
78
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
79 *'g:mf_plain_modes'*
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
80 Highlight keywords defined by modes.mf. This is set to 1 by default in
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
81 METAFONT buffers, and it is set to 0 by default in MetaPost buffers.
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
82
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
83 *'g:mp_close_tag'*
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
84 Define additional keywords that end indented blocks. For instance, if you
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
85 define:
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
86 >
31885
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 29885
diff changeset
87 g:mp_close_tag = ['\<endfoo\>']
29885
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
88 <
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
89 any line starting with `endfoo` will be de-indented compared to its previous
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
90 line.
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
91 >
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
92 g:mp_close_tag = []
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
93 <
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
94 *'b:mp_metafun'*
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
95 *'g:mp_metafun'*
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
96 If set to 1, highlight ConTeXt's MetaFun keywords. MetaPost only.
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
97 >
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
98 g:mp_metafun = 0
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
99 <
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
100 *'g:mp_mfplain_macros'*
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
101 Highlight keywords defined by mfplain.mp. MetaPost only.
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
102 >
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
103 g:mp_mfplain_macros = 1
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
104 <
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
105 *'g:mp_open_tag'*
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
106 Define additional keywords that start indented blocks. For instance, if you
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
107 define:
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
108 >
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
109 g:mp_open_tag = ['\<beginfoo\>']
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
110 <
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
111 the line following `beginfoo` will be indented.
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
112 >
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
113 g:mp_open_tag = []
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
114 <
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
115 *'g:mp_other_macros'*
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
116 Highlight keywords defined by all base macro packages (boxes, rboxes, format,
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
117 graph, marith, sarith, string, TEX). This option affects only MetaPost
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
118 buffers.
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
119 >
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
120 g:mp_other_macros = 1
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
121 <
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
122 *'g:mp_plain_macros'*
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
123 Highlight keywords defined by plain.mp. MetaPost only.
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
124 >
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
125 g:mp_plain_macros = 1
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
126 <
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
127 *'g:no_mp_maps'*
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
128 *'g:no_mf_maps'*
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
129 When set, do not define any mapping in buffers with the corresponding
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
130 filetype.
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
131 >
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
132 g:no_mp_maps = 0
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
133 g:no_mf_maps = 0
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
134 <
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
135 *ft-metapost-mappings*
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
136 *ft-metafont-mappings*
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
137 Mappings ~
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
138
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
139 ]] [count] vardefs, macros or figures forward.
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
140
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
141 [[ [count] vardefs, macros or figures backward.
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
142
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
143 ][ [count] end of vardefs, macros or figures forward.
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
144
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
145 [] [count] end of vardefs, macros or figures backward.
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
146
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
147 ]} [count] end of blocks (fi, endfor, endgroup) forward.
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
148
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
149 [{ [count] begin of blocks (if, for, begingroup) backward.
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
150
f00c56ee8118 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
151 vim:tw=78:sw=4:ts=8:noet:ft=help:norl: