I can define different highlight groups for different documents.
For example,
in a general text document, I would define highlight groups as Header1, Header2, Header3, and Normal Text, with different colors for each.
in a code example document, I would define highlight group as ClassName, FunctionName, VariableName, and KeyWord etc, with different colors for each.
Is it possible to make both in the same document? Some paragraphs are for general context, some are for code example.
The difficult is in different context, the way to notice the highlight groups are different. For example, in code example context, I would notice abc as def
pattern, and take abc
as VariableName
highlight group, as
as Keyword
, and def
as ClassName
group. However, in general text content, as
is a frequently appearing word. I find hard to separate them.
Is it possible to have a context mode
for highlight groups? For example a document starts as Normal Text
mode, where a bunch of highlight group recognition rules apply, then it can be toggled to Code Example
mode where another set applies?