Giter Club home page Giter Club logo

Comments (6)

arcticicestudio avatar arcticicestudio commented on July 18, 2024

Constant and Identifier are highlighted by using the default foreground nord4. I've designed it this way because every other group is colored different so the white color is a kind of highlighting. The Constant should differ from normal variables by their code style since almost every language uses all-upper-case for constants. A workaround could be to add the bold attribute for constants for a better visual diff.
The Special group is a bit "special": I've searched many documentations, but was not able to really find which element of a language is defined as special. Could you post a code example so I can test the highlighting?

from vim.

mkalinski avatar mkalinski commented on July 18, 2024

I don't think there's one definition of Special. It seems to me that most syntax files use this group for important elements that are specific to the language and do not easily fall under other groups.

Awk probably uses Special for too many things (including all operators and commas) but it's mostly used for special variable names and elements of regular expressions.

BEGIN {
  FS = "\t"
  some_var = 3
}

/A[[:space:]]B+\$/ {
  print $1
}

INI files use Special for section headings.

[foo]
bar = baz

Lisp uses it for quoted expressions.

(format t "~a" '(1 2 3))

Also, for syntaxes not included in vim by default (at least last time I checked): SWIG and Jinja both use Special like awk, for predefined variables that are not keywords, but have some built-in functionality.

And those are the ones I encountered so far since I'm trying out Nord.

I also wouldn't agree that Identifier and Constant should be left without highlighting because everything else is highlighted. Most of "normal" text in any program is not highlighted by default (without using some tagging or IDE plugins, at least), so if a syntax file defines highlighting for some static elements deemed as Identifier or Constant it usually has a reason to. For example, Lua uses Constant for true, false and nil, and Java uses it for null.

from vim.

arcticicestudio avatar arcticicestudio commented on July 18, 2024

I have to admit that I must have been a little bit "brain-afk" when I implemented the Constant definition 😱
I use IntelliJ IDEA for almost everything, next to Atom as my normal default UI editor. IntelliJ detects a constant dynamically because it is a IDE, but Vim and the language syntax plugin of course can only define pattern so I confused a Constant with a user-defined read-only variable 😆

You're totally right that some languages define elements like true, false nil/null as constants and these should be colored for sure. I'll change it to use nord8 so they're colored as a kind of reserved keyword.

For the Special definition I'm still not sure if it should have a final color. I checked your code examples and the elements are using the Special group as a fallback color because the actual group they're assigned to is not defined in Nord.
This can easily be fixed by adding style support for these languages to Nord.

awk

Element Group
BEGIN awkPattern
FS awkVariables
= awkOperator
\t awkSpecialCharacter
+\$ awkSearch, awkRegExp, awkSpecialCharacter
$1 awkFieldVars

INI

Element Group
[foo] dosiniHeader
bar = dosiniLabel

Lisp

Element Group
(1 2 3) lispAtomList

I have to agree for Lisp that both braces are colored by using the Special group, only the numbers inside are assigned to lispAtomList. In my option a bad syntax implementation and I don't know why it is not colored by using the base group Delimiter 😕

Since Nord is designed to provide optimized styles to achieve a consistent and uniform coloring across languages I try to add all popular languages and optimize the syntax to be consistent with other languages instead of only defining the base groups which would lead to different results for example a class in Java and a class in other languages like JavaScript or Python.

You can create a issue per language you'd like to see being included and maybe describe which elements should be optimized.

from vim.

arcticicestudio avatar arcticicestudio commented on July 18, 2024

I'll create single issues for each of the language mentioned above and implement full highlighting support next weekend.

from vim.

arcticicestudio avatar arcticicestudio commented on July 18, 2024

The problem with the Special group is that many syntax highlighting plugin creator are like "this language element doen't fit in any of the specifi groups so I just put it into Special".
If I'd colorize the Special group now with for example nord9 some languages would have blue braces, some would have almost every word colored (which makes highlighting useless again) and other languages for debug purposes.

That's why I'll go with the more complex mehod by implementing styles for every plugin/language specific group, but this keeps the theme style consitent and avoids unintentional colorized elements.

from vim.

arcticicestudio avatar arcticicestudio commented on July 18, 2024

I've implemented support for all three languages mentioned above in the issues references above this comment. All groups which are using Special as fallback are now mapped to a matching group.
Please let me know if you find other languages that should have better coloring support or would like to suggest improvements and feel free to open new issues per language.

AWK

Lisp

(DOS) INI

from vim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.