From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Custom syntax highlighting
Date: Wed, 2 Mar 2016 15:11:56 -0500 (EST) [thread overview]
Message-ID: <alpine.OSX.2.02.1603021505050.8892@nqv-znpobbx> (raw)
In-Reply-To: <nb7gkh$p84$1@ger.gmane.org>
On Wed, 2 Mar 2016, Nicola wrote:
> On 2016-03-02 19:34:00 +0000, Aditya Mahajan said:
>
>> On Wed, 2 Mar 2016, Nicola wrote:
>>
>>> On 2016-03-01 15:35:07 +0000, Aditya Mahajan said:
>>>
>>>> On Tue, 1 Mar 2016, Nicola wrote:
>>>>
>>>>> I'm using the latest beta, and I need syntax coloring for SQL
>>>>> (PostgreSQL variant). According to the wiki, there is no SQL
>>>>> syntax coloring available for MKIV yet, but I'd be happy to
>>>>> be wrong :)
>>>>
>>>> You can use the vim module:
>>>>
>>>> https://github.com/adityam/filter/blob/master/vim-README.md
>>>
>>> I've set up your module and it works perfectly. It saved me a
>>> lot of time! But I need help for one more thing:
>>> \inlineMYLANG{X} adds a new line before and after X, as in
>>> \startMYLANG X \stopMYLANG. How do I prevent that? Well, why
>>> is that the case to begin with?
>>
>> It shouldn't. Can you send me a minimal example.
>
> I have figured out myself: I have defined
>
> \definevimtyping[pgsql][..., before={\blank},after={\blank}, ...]
>
> which, I have realized, applies to inline text, too. How do I set up
> the environment so that there is some blank space before and after
> without affecting inline code?
You can change the space before and after display environments using
spacebefore and spaceafter keys (see the documentation of filter
module[1], which is used by the vim module)
There are two modes: location=paragraph and location=text. In
location=paragraph you get
\blank[<spacebefore>]
<before>
<filtered content>
<after>
\blank[<spaceafter>]
In location=text (which is used by \inline...) you get
<left> <filtered content> <right>
The behaviour that you see is because, by default, I have set
\c!left=\externalfilterparameter\c!before,
\c!right=\externalfilterparameter\c!after,
Looking at git-blame, I see that this was always the case, ever since the
left and right keys were added (I guess to keep backward compatibility at
that time). Looking back, I think that this is not a good default and I
will change it.
In the meanwhile, simply use
\definevimtyping[...][left=, right=,]
Aditya
[1]: https://github.com/adityam/filter
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2016-03-02 20:11 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-01 15:26 Nicola
2016-03-01 15:35 ` Aditya Mahajan
2016-03-01 18:14 ` Nicola
2016-03-02 2:14 ` Aditya Mahajan
2016-03-02 8:46 ` Nicola
2016-03-02 14:45 ` Aditya Mahajan
2016-03-02 15:23 ` Nicola
2016-03-02 11:06 ` Nicola
2016-03-02 11:20 ` Nicola
2016-03-02 18:21 ` Nicola
2016-03-02 19:34 ` Aditya Mahajan
2016-03-02 19:58 ` Nicola
2016-03-02 20:11 ` Aditya Mahajan [this message]
2016-03-02 20:29 ` Nicola
2016-03-01 21:53 ` Hans Hagen
2016-03-02 8:56 ` Nicola
2016-03-02 9:13 ` Hans Hagen
2016-03-02 10:45 ` Nicola
2016-03-02 23:16 ` Alan BRASLAU
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.OSX.2.02.1603021505050.8892@nqv-znpobbx \
--to=adityam@umich.edu \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).