ANN: Updated Vim scripts for METAFONT/MetaPost
Nicola <[email protected]>
| Newsgroups | gmane.comp.tex.metapost,gmane.comp.tex.context |
|---|---|
| Message-ID | <[email protected]> |
Hello,
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
./vim/after/ftplugin/context.vim:
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!
Nicola
--
http://tug.org/metapost/
mp.tgz
(application/octet-stream, 11 KB) - not displayed