ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* t-vim module: no highlighting for custom filetypes
@ 2021-05-21 10:48 Nicola
  2021-05-21 12:56 ` Nicola
  0 siblings, 1 reply; 14+ messages in thread
From: Nicola @ 2021-05-21 10:48 UTC (permalink / raw)
  To: ntg-context

For some reason, the vim module has stopped highlighting code associated
to custom filetypes (it still works for built-in filetypes).

For instance, typeset this:

    \usemodule[vim]

    \startvimrc[name=foo]
      set nocompatible
      set runtimepath+=~/foo/
    \stopvimrc

    \definevimtyping[foo][
      style={\switchtobodyfont[16pt,tt]},
      directory=code/,
      syntax=foo,
      alternative=pscolor,
      vimrc=foo,
    ]

    \starttext
    \startfoo
      let while endwhile
    \stopfoo
    \stoptext


The ~/foo/ directory contains ftdetect/foo.vim:

    au BufRead,BufNewFile *.foo setfiletype foo

and syntax/foo.vim:

    if exists("b:current_syntax")
      finish
    endif

    syn case match
    syn iskeyword @,48-57,192-255,_

    syn keyword fooKeyword let while endwhile

    hi def link fooKeyword Keyword

    let b:current_syntax = "foo"

If I change `syntax=foo` to, say, `syntax=vim` in \definevimtyping
then the code is highlighted.  So, I suspect that I am not configuring
the runtimepath correctly. Any idea how to fix this?

I am using the latest LMTX to which I have added modules as explained
here:

    https://wiki.contextgarden.net/Modules#ConTeXt_LMTX

t-vim VERSION reads 2021.03.01.

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] 14+ messages in thread

end of thread, other threads:[~2021-05-28 10:46 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-21 10:48 t-vim module: no highlighting for custom filetypes Nicola
2021-05-21 12:56 ` Nicola
2021-05-21 14:28   ` Aditya Mahajan
2021-05-21 19:37     ` Nicola
2021-05-22  6:58       ` Hans Hagen
2021-05-22 16:15         ` Aditya Mahajan
2021-05-23 10:04           ` Hans Hagen
2021-05-23 22:38             ` Aditya Mahajan
2021-05-24 19:24       ` Aditya Mahajan
2021-05-27 19:51         ` Nicola
2021-05-27 20:16           ` Aditya Mahajan
2021-05-27 20:27             ` Nicola
2021-05-28  6:41               ` Aditya Mahajan
2021-05-28 10:46                 ` Nicola

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