[metapost] ANN: Updated Vim scripts for METAFONT/MetaPost

Nicola nvitacolonna at gmail.com
Sun Sep 18 12:46:44 CEST 2016

as a Vim user, I was not satisfied with its support for MetaPost
(especially indenting). I have updated the {mf,mp}.vim scripts
in Vim, which you find attached, and which I have forwarded to
the respective maintainers. Hopefully, they will be included in
a future release of Vim. For the time being, just unpack and put
in your .vim folder.

I have tested these scripts and they work fine for me. But if
you use Vim, I would be glad if you could try them and report
your feedback.

New things:

- *all* METAFONT/MetaPost, mplain.{mp,mf} keywords are highlighted
  in the respective file types! Up to date with mpost 1.991.
- Indentation should work *much* better; and you may use 'markers'
  to force indentation patterns (see indent/mp.vim) because, you
  know, a machine will never get MetaPost indentation right ;)
- Keyword omnicompletion (courtesy of Vim's syntaxcomplete)!
  Trigger with <c-x><c-o>.
- You may jump between figures, macros and blocks using standard
  mappings: [[, ]], ][, [], [{, ]}.
- Support for the matchit plugin (e.g., with the cursor on 'if',
  type % to jump to the corresponding 'fi').

ConTeXt users will benefit from these scripts, too, inside MetaPost
environments. Unfortunately, only the syntax file is available in a
ConTeXt document. For omnicompletion, you may put these in

setlocal omnifunc=syntaxcomplete#Complete
let g:omni_syntax_group_include_context='mf\w\+,mp\w\+'

Not ideal, but it works. For indentation, I'm still investigating
possible workarounds.

Happy typesetting!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mp.tgz
Type: application/octet-stream
Size: 11227 bytes
Desc: not available
URL: <http://tug.org/pipermail/metapost/attachments/20160918/bf72ec44/attachment.obj>

More information about the metapost mailing list