ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* ANN: Updated Vim scripts for METAFONT/MetaPost
@ 2016-09-18 10:46 Nicola
  2016-09-18 12:05 ` Nicola
  2016-09-18 12:09 ` luigi scarso
  0 siblings, 2 replies; 6+ messages in thread
From: Nicola @ 2016-09-18 10:46 UTC (permalink / raw)
  To: metapost; +Cc: ntg-context

[-- Attachment #1: Type: text/plain, Size: 1570 bytes --]

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


[-- Attachment #2: mp.tgz --]
[-- Type: application/octet-stream, Size: 11227 bytes --]

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



[-- Attachment #4: Type: text/plain, Size: 27 bytes --]

--
http://tug.org/metapost/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-10-05  8:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-18 10:46 ANN: Updated Vim scripts for METAFONT/MetaPost Nicola
2016-09-18 12:05 ` Nicola
2016-09-18 12:09 ` luigi scarso
2016-09-18 14:32   ` Nicola
     [not found]   ` <nrm87q$bkn$1@blaine.gmane.org>
2016-10-05  8:26     ` Nicola
2016-10-05  8:35       ` luigi scarso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).