ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Custom color schemes in t-vim
@ 2020-05-14 10:42 Nicola
  2020-05-14 15:44 ` Aditya Mahajan
  0 siblings, 1 reply; 13+ messages in thread
From: Nicola @ 2020-05-14 10:42 UTC (permalink / raw)
  To: ntg-context

Quick question: Is \startcolorscheme... \stopcolorscheme (still)
supported by t-vim?

In a template I wrote long time ago to typeset code, I have:

    \usemodule[vim]
    \unprotect
    \startcolorscheme[oceansunset]
      \definesyntaxgroup[Comment][\c!color={colortwo},\c!style=italic]
      % etc.
    \stopcolorscheme
    \protect

which I use as described in the wiki:

    \definevimtyping
         [...]
         [...
          alternative=oceansunset,
          ...]

But that does not seem to have any effect (if I change the colors, the
syntax highlighting does not change). I can use pscolor and
blackandwhite, though. I see that \startcolorscheme is not documented,
so maybe there is another mechanism?

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

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

* Re: Custom color schemes in t-vim
  2020-05-14 10:42 Custom color schemes in t-vim Nicola
@ 2020-05-14 15:44 ` Aditya Mahajan
  2020-05-16 11:34   ` Nicola
  0 siblings, 1 reply; 13+ messages in thread
From: Aditya Mahajan @ 2020-05-14 15:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, 14 May 2020, Nicola wrote:

> Quick question: Is \startcolorscheme... \stopcolorscheme (still)
> supported by t-vim?
>
> In a template I wrote long time ago to typeset code, I have:
>
>    \usemodule[vim]
>    \unprotect
>    \startcolorscheme[oceansunset]
>      \definesyntaxgroup[Comment][\c!color={colortwo},\c!style=italic]
>      % etc.
>    \stopcolorscheme
>    \protect
>
> which I use as described in the wiki:
>
>    \definevimtyping
>         [...]
>         [...
>          alternative=oceansunset,
>          ...]
>
> But that does not seem to have any effect (if I change the colors, the
> syntax highlighting does not change). I can use pscolor and
> blackandwhite, though. I see that \startcolorscheme is not documented,
> so maybe there is another mechanism?

It is supposed to work. If it doesn't, then it is a bug. Could you provide a complete MWE.

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
___________________________________________________________________________________

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

* Re: Custom color schemes in t-vim
  2020-05-14 15:44 ` Aditya Mahajan
@ 2020-05-16 11:34   ` Nicola
  2020-05-16 14:46     ` Aditya Mahajan
  0 siblings, 1 reply; 13+ messages in thread
From: Nicola @ 2020-05-16 11:34 UTC (permalink / raw)
  To: ntg-context

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 actual behaviour is that comments are highlighted correctly, but
I do not get any syntax highlighting for functions.

Thanks for t-vim, btw: I can't express in words how nice an idea it is!

Nicola

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setupcolors[state=start]

\definecolor[colorone]    [r=0.251, g=0.349, b=0.322]
\definecolor[colortwo]    [r=0.612, g=0.608, b=0.478]
\definecolor[colorthree]  [r=1.0,   g=0.827, b=0.576]
\definecolor[colorfour]   [r=1.0,   g=0.592, b=0.310]
\definecolor[colorfive]   [r=0.960, g=0.310, b=0.161]
\definecolor[nearlywhite] [r=0.988, g=0.988, b=0.988]

\setupinteraction[state=start]
\setupcolors[textcolor=colorone]
\setupbackgrounds[page][background=color,backgroundcolor=nearlywhite]

\usemodule[vim]
\unprotect
\startcolorscheme[oceansunset]
  \definesyntaxgroup[Comment][\c!color={colorfive},\c!style=italic]
  \definesyntaxgroup[Function][\c!color={colorfive},\c!style=italic]
  % \definesyntaxgroup[rubyMethodName][\c!color={colorfive},\c!style=italic]
  % \definesyntaxgroup[javaScriptFunction][\c!color={colorfive},\c!style=italic]
\stopcolorscheme
\protect

\definevimtyping[JAVASCRIPT][
  syntax=javascript,
  alternative=oceansunset,
  escape=on
]

\definevimtyping[RUBY][
  syntax=ruby,
  alternative=oceansunset,
  escape=on
]

\starttext
\startJAVASCRIPT
// JavaScript program listing
function foobar() {
  print("Hello World");
}
\stopJAVASCRIPT

\startRUBY
# Ruby program listing
def foobar
  print("Hello World")
end
\stopRUBY
\stoptext
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: Custom color schemes in t-vim
  2020-05-16 11:34   ` Nicola
@ 2020-05-16 14:46     ` Aditya Mahajan
  2020-05-16 15:03       ` Aditya Mahajan
  0 siblings, 1 reply; 13+ messages in thread
From: Aditya Mahajan @ 2020-05-16 14:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________

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

* Re: Custom color schemes in t-vim
  2020-05-16 14:46     ` Aditya Mahajan
@ 2020-05-16 15:03       ` Aditya Mahajan
  2020-05-16 19:24         ` Nicola
  0 siblings, 1 reply; 13+ messages in thread
From: Aditya Mahajan @ 2020-05-16 15:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, 16 May 2020, Aditya Mahajan wrote:

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

Moreover, if you comment line line 126 of `2context.vim`

     "let s:id      = synIDtrans (s:id)

[If you make a local copy of 2context.vim, then you need to run the file with `--mode=dev-vim` to ensure that the local copy is used]

Then the ruby example generates the following file:

\SYNBOL{}\SYN[rubyComment]{# Ruby program listing}\SYNEOL{}
\SYNBOL{}\SYN[rubyDefine]{def}\SYN[rubyMethodBlock]{ }\SYN[rubyMethodName]{foobar}\SYNEOL{}
\SYNBOL{}\SYN[rubyMethodBlock]{  print(}\SYN[rubyStringDelimiter]{"}\SYN[rubyString]{Hello World}\SYN[rubyStringDelimiter]{"}\SYN[rubyMethodBlock]{)}\SYNEOL{}
\SYNBOL{}\SYN[rubyDefine]{end}\SYNEOL{}

So, if you are willing to define wrappers for all ruby syntax blocks, then I can provide a configuration option so that `2context` does not apply that line.

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
___________________________________________________________________________________

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

* Re: Custom color schemes in t-vim
  2020-05-16 15:03       ` Aditya Mahajan
@ 2020-05-16 19:24         ` Nicola
  2020-05-17  0:42           ` Aditya Mahajan
  0 siblings, 1 reply; 13+ messages in thread
From: Nicola @ 2020-05-16 19:24 UTC (permalink / raw)
  To: ntg-context

On 2020-05-16, Aditya Mahajan <adityam@umich.edu> wrote:
> On Sat, 16 May 2020, Aditya Mahajan wrote:

> Moreover, if you comment line line 126 of `2context.vim`
>
>      "let s:id      = synIDtrans (s:id)
>
> [If you make a local copy of 2context.vim, then you need to run the
> file with `--mode=dev-vim` to ensure that the local copy is used]
>
> Then the ruby example generates the following file:
>
> \SYNBOL{}\SYN[rubyComment]{# Ruby program listing}\SYNEOL{}
> \SYNBOL{}\SYN[rubyDefine]{def}\SYN[rubyMethodBlock]{ }\SYN[rubyMethodName]{foobar}\SYNEOL{}
> \SYNBOL{}\SYN[rubyMethodBlock]{  print(}\SYN[rubyStringDelimiter]{"}\SYN[rubyString]{Hello World}\SYN[rubyStringDelimiter]{"}\SYN[rubyMethodBlock]{)}\SYNEOL{}
> \SYNBOL{}\SYN[rubyDefine]{end}\SYNEOL{}
>
> So, if you are willing to define wrappers for all ruby syntax blocks,
> then I can provide a configuration option so that `2context` does not
> apply that line.

That might provide a finer control over the highlighting, but the main
issue here seems to be that the generated file has Identifier instead of
Function, Special instead of Delimiter and Constant instead of String.
Looking at 2context.vim, AFAICS s:id_name seems computed correctly.
Maybe, the script does not set the appropriate filetype?

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

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

* Re: Custom color schemes in t-vim
  2020-05-16 19:24         ` Nicola
@ 2020-05-17  0:42           ` Aditya Mahajan
  2020-05-17  6:36             ` Aditya Mahajan
  0 siblings, 1 reply; 13+ messages in thread
From: Aditya Mahajan @ 2020-05-17  0:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, 16 May 2020, Nicola wrote:

> On 2020-05-16, Aditya Mahajan <adityam@umich.edu> wrote:
>> On Sat, 16 May 2020, Aditya Mahajan wrote:
>
>> Moreover, if you comment line line 126 of `2context.vim`
>>
>>      "let s:id      = synIDtrans (s:id)
>>
>> [If you make a local copy of 2context.vim, then you need to run the
>> file with `--mode=dev-vim` to ensure that the local copy is used]
>>
>> Then the ruby example generates the following file:
>>
>> \SYNBOL{}\SYN[rubyComment]{# Ruby program listing}\SYNEOL{}
>> \SYNBOL{}\SYN[rubyDefine]{def}\SYN[rubyMethodBlock]{ }\SYN[rubyMethodName]{foobar}\SYNEOL{}
>> \SYNBOL{}\SYN[rubyMethodBlock]{  print(}\SYN[rubyStringDelimiter]{"}\SYN[rubyString]{Hello World}\SYN[rubyStringDelimiter]{"}\SYN[rubyMethodBlock]{)}\SYNEOL{}
>> \SYNBOL{}\SYN[rubyDefine]{end}\SYNEOL{}
>>
>> So, if you are willing to define wrappers for all ruby syntax blocks,
>> then I can provide a configuration option so that `2context` does not
>> apply that line.

> That might provide a finer control over the highlighting, but the main
> issue here seems to be that the generated file has Identifier instead of
> Function, Special instead of Delimiter and Constant instead of String.
> Looking at 2context.vim, AFAICS s:id_name seems computed correctly.
> Maybe, the script does not set the appropriate filetype?

filetype is set correctly (since we get `ruby....` options), but something weird is happening even with 2html.vim. Here is a minimal example:

```test.rb
# Ruby program listing
def foobar
   print("Hello World")
end
```

Run:

vim -u NONE -c "syntax manual" -c "set syntax=ruby" -c "source /usr/share/nvim/runtime/syntax/2html.vim" -c "wqa" test.rb

gives

```test.rb.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
...
</head>
<body>
<pre id='vimCodeElement'>
<span class="Comment"># Ruby program listing</span>
<span class="PreProc">def</span> <span class="Identifier">foobar</span>
   print(<span class="Special">&quot;</span><span class="Constant">Hello World</span><span class="Special">&quot;</span>)
<span class="PreProc">end</span>

</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->
```

which is similar to what 2context.vim gets. If I source tohtml.vim or 2context.vim from an existing vim session, then the tags are correct. I have not been able to figure out why this is happening.

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
___________________________________________________________________________________

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

* Re: Custom color schemes in t-vim
  2020-05-17  0:42           ` Aditya Mahajan
@ 2020-05-17  6:36             ` Aditya Mahajan
  2020-05-17  7:41               ` Aditya Mahajan
  0 siblings, 1 reply; 13+ messages in thread
From: Aditya Mahajan @ 2020-05-17  6:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, 16 May 2020, Aditya Mahajan wrote:

> On Sat, 16 May 2020, Nicola wrote:
>
>> On 2020-05-16, Aditya Mahajan <adityam@umich.edu> wrote:
>>> On Sat, 16 May 2020, Aditya Mahajan wrote:
>>
>>> Moreover, if you comment line line 126 of `2context.vim`
>>>
>>>      "let s:id      = synIDtrans (s:id)
>>>
>>> [If you make a local copy of 2context.vim, then you need to run the
>>> file with `--mode=dev-vim` to ensure that the local copy is used]
>>>
>>> Then the ruby example generates the following file:
>>>
>>> \SYNBOL{}\SYN[rubyComment]{# Ruby program listing}\SYNEOL{}
>>> \SYNBOL{}\SYN[rubyDefine]{def}\SYN[rubyMethodBlock]{ 
> }\SYN[rubyMethodName]{foobar}\SYNEOL{}
>>> \SYNBOL{}\SYN[rubyMethodBlock]{ 
> print(}\SYN[rubyStringDelimiter]{"}\SYN[rubyString]{Hello 
> World}\SYN[rubyStringDelimiter]{"}\SYN[rubyMethodBlock]{)}\SYNEOL{}
>>> \SYNBOL{}\SYN[rubyDefine]{end}\SYNEOL{}
>>>
>>> So, if you are willing to define wrappers for all ruby syntax blocks,
>>> then I can provide a configuration option so that `2context` does not
>>> apply that line.
>
>> That might provide a finer control over the highlighting, but the main
>> issue here seems to be that the generated file has Identifier instead of
>> Function, Special instead of Delimiter and Constant instead of String.
>> Looking at 2context.vim, AFAICS s:id_name seems computed correctly.
>> Maybe, the script does not set the appropriate filetype?
>
> filetype is set correctly (since we get `ruby....` options), but something 
> weird is happening even with 2html.vim. Here is a minimal example:

Figured out what is happening. From `:he syntax`

"The names marked with * are the preferred groups; the others are minor groups.
For the preferred groups, the "syntax.vim" file contains default highlighting.
The minor groups are linked to the preferred groups, so they get the same
highlighting.  You can override these defaults by using ":highlight" commands
after sourcing the "syntax.vim" file."

All three `Function`, `Delimiter` and `String` are minor groups, so they get mapped to the preferred groups, which are `Identifier`, `Special`, and `Constant`, respectively. Most colorschemes define colors for minor groups as well, but since we are not loading any colorscheme, the minor groups are mapped to preferred groups, and we only get the preferred groups in the output.

Now that I know what is happening, it is relatively easy to fix.

```
\definecolor[colorone]    [r=0.251, g=0.349, b=0.322]
\definecolor[colortwo]    [r=0.612, g=0.608, b=0.478]
\definecolor[colorthree]  [r=1.0,   g=0.827, b=0.576]
\definecolor[colorfour]   [r=1.0,   g=0.592, b=0.310]
\definecolor[colorfive]   [r=0.960, g=0.310, b=0.161]
\definecolor[nearlywhite] [r=0.988, g=0.988, b=0.988]

\setupinteraction[state=start]
\setupcolors[textcolor=colorone]
\setupbackgrounds[page][background=color,backgroundcolor=nearlywhite]

\usemodule[vim]

\startvimrc[name=minor-groups]
hi Function  cterm=NONE
hi String    cterm=NONE
hi Delimiter cterm=NONE
\stopvimrc


\startcolorscheme[oceansunset]
   \definesyntaxgroup[Comment] [color={colorfive},style=italic]
   \definesyntaxgroup[Function][color={colorfive},style=italic]
\stopcolorscheme

\definevimtyping[RUBY]
     [
       syntax=ruby,
       alternative=oceansunset,
       escape=on, %NOTE, the comma was missing in your test file
       % Without the comma, the option is not set
       extras=minor-groups,
     ]

\starttext
\startRUBY
# Ruby program listing
def foobar
   print("Hello World")
end
\stopRUBY
\stoptext
```

Since I already map the minor groups to preferred groups in `t-vim`, I think that a good compromise is to enable the minor groups by default. I can do that by adding statements similar to those above in `2context.vim`. This will not have any visual impact on any existing code, but will allow those who want to tweak the highlighting of minor groups to define their own syntax highlighting.

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
___________________________________________________________________________________

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

* Re: Custom color schemes in t-vim
  2020-05-17  6:36             ` Aditya Mahajan
@ 2020-05-17  7:41               ` Aditya Mahajan
  2020-05-17  8:34                 ` Nicola
  0 siblings, 1 reply; 13+ messages in thread
From: Aditya Mahajan @ 2020-05-17  7:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> Since I already map the minor groups to preferred groups in `t-vim`, I think 
> that a good compromise is to enable the minor groups by default. I can do 
> that by adding statements similar to those above in `2context.vim`. This will 
> not have any visual impact on any existing code, but will allow those who 
> want to tweak the highlighting of minor groups to define their own syntax 
> highlighting.

Uploaded a new version with a fix.

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
___________________________________________________________________________________

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

* Re: Custom color schemes in t-vim
  2020-05-17  7:41               ` Aditya Mahajan
@ 2020-05-17  8:34                 ` Nicola
  2020-05-17 10:27                   ` Nicola
                                     ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Nicola @ 2020-05-17  8:34 UTC (permalink / raw)
  To: ntg-context

On 2020-05-17, Aditya Mahajan <adityam@umich.edu> wrote:
>> Since I already map the minor groups to preferred groups in `t-vim`, I think
>> that a good compromise is to enable the minor groups by default. I can do
>> that by adding statements similar to those above in `2context.vim`. This will
>> not have any visual impact on any existing code, but will allow those who
>> want to tweak the highlighting of minor groups to define their own syntax
>> highlighting.
>
> Uploaded a new version with a fix.

Thanks for looking into it. I will download and test that soon.

A couple of remarks:

1. In one of my old documents, I had this command inside the colorscheme
   block:

    \setups{vim-minor-groups}

   Was that to achieve the same purpose?

2. The wiki has no mention of \startcolorscheme... \stopcolorscheme or
   \setups. An example of two would be very welcome!

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

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

* Re: Custom color schemes in t-vim
  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
  2 siblings, 0 replies; 13+ messages in thread
From: Nicola @ 2020-05-17 10:27 UTC (permalink / raw)
  To: ntg-context

On 2020-05-17, Nicola <nvitacolonna@gmail.com> wrote:
> On 2020-05-17, Aditya Mahajan <adityam@umich.edu> wrote:

>> Uploaded a new version with a fix.

I have tried the latest beta and, indeed, it now seems to work as
expected.

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

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

* Re: Custom color schemes in t-vim
  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
  2 siblings, 0 replies; 13+ messages in thread
From: Aditya Mahajan @ 2020-05-17 15:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, 17 May 2020, Nicola wrote:

> On 2020-05-17, Aditya Mahajan <adityam@umich.edu> wrote:
>>> Since I already map the minor groups to preferred groups in `t-vim`, I think
>>> that a good compromise is to enable the minor groups by default. I can do
>>> that by adding statements similar to those above in `2context.vim`. This will
>>> not have any visual impact on any existing code, but will allow those who
>>> want to tweak the highlighting of minor groups to define their own syntax
>>> highlighting.
>>
>> Uploaded a new version with a fix.
>
> Thanks for looking into it. I will download and test that soon.
>
> A couple of remarks:
>
> 1. In one of my old documents, I had this command inside the colorscheme
>   block:
>
>    \setups{vim-minor-groups}
>
>   Was that to achieve the same purpose?

Yes. This setup maps the minor groups to preferred groups.

> 2. The wiki has no mention of \startcolorscheme... \stopcolorscheme or
>   \setups. An example of two would be very welcome!

OK. I will add 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
___________________________________________________________________________________

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

* Re: Custom color schemes in t-vim
  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
  2 siblings, 0 replies; 13+ messages in thread
From: Aditya Mahajan @ 2020-05-18  5:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, 17 May 2020, Nicola wrote:
> 2. The wiki has no mention of \startcolorscheme... \stopcolorscheme or
>   \setups. An example of two would be very welcome!

Added documentation: https://github.com/adityam/filter/blob/dev/vim-README.md

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
___________________________________________________________________________________

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

end of thread, other threads:[~2020-05-18  5:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-14 10:42 Custom color schemes in t-vim Nicola
2020-05-14 15:44 ` Aditya Mahajan
2020-05-16 11:34   ` Nicola
2020-05-16 14:46     ` Aditya Mahajan
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

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