ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Custom color schemes in t-vim
Date: Sat, 16 May 2020 10:46:45 -0400 (EDT)	[thread overview]
Message-ID: <nycvar.YAK.7.77.849.2005161033360.225319@nqv-guvaxcnq> (raw)
In-Reply-To: <r9oj4e$3ue5$1@ciao.gmane.io>

On Sat, 16 May 2020, Nicola wrote:

> On 2020-05-14, Aditya Mahajan <adityam@umich.edu> wrote:
>> On Thu, 14 May 2020, Nicola wrote:
>>
>>> Quick question: Is \startcolorscheme... \stopcolorscheme (still)
>>> supported by t-vim?
>
>> It is supposed to work. If it doesn't, then it is a bug. Could you
>> provide a complete MWE.
>
> Please find a MWE at the bottom of this post.
>
> The expected behaviour is that the keyword `function` in the JavaScript
> snippet and `foobar` in the Ruby snippet should be colored and in
> italics, as comments are. The respective Vim highlight groups are
> `javaScriptFunction` and `rubyMethodName`, which both resolve to
> `Function`.

The reason that there is no highlighting is because the generated `.vimout` does not contain any `\SYN[rubyMethodName]` or `\SYN[javaScriptFunction]` for the following reason:

Vim has the concept of a hierarchy of names for the syntax highlighting regions. For example, $VIMRUNTIME/syntax/ruby.rb contains the following lines:

     hi def link rubyMethodName  rubyFunction
     hi def link rubyFunction  Function

So, `rubyMethodName` maps to `rubyFunction`, which in turn maps to `Function`. Now, a vim colorscheme first checks if a highlighting style is available for `rubyMethodName`; if not it tries `rubyFunction`; and if not it tries `Function`.

Although something similar might have been possible in 2context.vim, I follow the `TOHtml` function of vim, and simply created a single tag for each syntax highlighting element, which in this case is `Function`. So, there is no tag generated for `rubyMethodName` and that is why changing the syntaxhighlight for that doesn't change anything.

Now, as I was looking into this, I noticed that `foobar` gets mapped to `Identifier` rather than `Function`. I am not sure why that is happening and I will look into that.

Aditya

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2020-05-16 14:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-14 10:42 Nicola
2020-05-14 15:44 ` Aditya Mahajan
2020-05-16 11:34   ` Nicola
2020-05-16 14:46     ` Aditya Mahajan [this message]
2020-05-16 15:03       ` Aditya Mahajan
2020-05-16 19:24         ` Nicola
2020-05-17  0:42           ` Aditya Mahajan
2020-05-17  6:36             ` Aditya Mahajan
2020-05-17  7:41               ` Aditya Mahajan
2020-05-17  8:34                 ` Nicola
2020-05-17 10:27                   ` Nicola
2020-05-17 15:21                   ` Aditya Mahajan
2020-05-18  5:30                   ` Aditya Mahajan

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=nycvar.YAK.7.77.849.2005161033360.225319@nqv-guvaxcnq \
    --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).