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

* Re: ANN: Updated Vim scripts for METAFONT/MetaPost
  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
  1 sibling, 0 replies; 6+ messages in thread
From: Nicola @ 2016-09-18 12:05 UTC (permalink / raw)
  To: ntg-context

On 2016-09-18 10:46:44 +0000, Nicola said:

>  I have updated the {mf,mp}.vim scripts in Vim

> ConTeXt users will benefit from these scripts, too, inside MetaPost
> environments.

Put these lines in ./vim/after/ftplugin/context.vim:

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

(note the ..._context_mp) and set the filetype of your document as
follows:

:set ft=context.mp

The only drawback is that indentation rules are applied throughout the
whole document, not only to the MetaPost parts. Depending on how many
'if' and 'forever' there are in your novel, it might get annoying.

Nicola


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: ANN: Updated Vim scripts for METAFONT/MetaPost
  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>
  1 sibling, 2 replies; 6+ messages in thread
From: luigi scarso @ 2016-09-18 12:09 UTC (permalink / raw)
  Cc: mailing list for ConTeXt users, MetaPost List

On Sun, Sep 18, 2016 at 12:46 PM, Nicola <nvitacolonna@gmail.com> wrote:
> 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.

Thank you very much !


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


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

* Re: ANN: Updated Vim scripts for METAFONT/MetaPost
  2016-09-18 12:09 ` luigi scarso
@ 2016-09-18 14:32   ` Nicola
       [not found]   ` <nrm87q$bkn$1@blaine.gmane.org>
  1 sibling, 0 replies; 6+ messages in thread
From: Nicola @ 2016-09-18 14:32 UTC (permalink / raw)
  To: ntg-context

On 2016-09-18 12:09:12 +0000, luigi scarso said:

> On Sun, Sep 18, 2016 at 12:46 PM, Nicola <nvitacolonna@gmail.com> wrote:
>> 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.
> 
> Thank you very much !

Mini ascii-cast: https://asciinema.org/a/9a101ghqmipqqmw3x61erwmx8

Nicola


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: ANN: Updated Vim scripts for METAFONT/MetaPost
       [not found]   ` <nrm87q$bkn$1@blaine.gmane.org>
@ 2016-10-05  8:26     ` Nicola
  2016-10-05  8:35       ` luigi scarso
  0 siblings, 1 reply; 6+ messages in thread
From: Nicola @ 2016-10-05  8:26 UTC (permalink / raw)
  To: metapost; +Cc: ntg-context

On 2016-09-18 14:27:08 +0000, Nicola said:

> On 2016-09-18 12:09:12 +0000, luigi scarso said:
> 
>> On Sun, Sep 18, 2016 at 12:46 PM, Nicola <nvitacolonna@gmail.com> wrote:
>>> 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.
>> 
>> Thank you very much !
> 
> Mini ascii-cast: https://asciinema.org/a/9a101ghqmipqqmw3x61erwmx8

FYI:
https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca

Click on "changed files".

Nicola


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


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

* Re: ANN: Updated Vim scripts for METAFONT/MetaPost
  2016-10-05  8:26     ` Nicola
@ 2016-10-05  8:35       ` luigi scarso
  0 siblings, 0 replies; 6+ messages in thread
From: luigi scarso @ 2016-10-05  8:35 UTC (permalink / raw)
  To: Nicola; +Cc: mailing list for ConTeXt users, MetaPost List

On Wed, Oct 5, 2016 at 10:26 AM, Nicola <nvitacolonna@gmail.com> wrote:
> FYI:
> https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
>
> Click on "changed files".
>
good.

Btw
http://www.guitex.org/home/meeting

-- 
luigi
--
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).