Sublime Forum

Different approach to syntax highlighting

#1

I found an article this morning describing a different approach to syntax highlighting. The idea looks great but I wonder, how would you go about implementing this in ST? Is it even possible via a plugin?

Here’s the article: medium.com/p/3a6db2743a1e/

0 Likes

Give different colors to each variable?
Color values instead of tags
Colorcoder
#2

Semantic highlighting would make me gladly pay for sublime text 3

0 Likes

#3

To change the colors, you have to recreate the syntax file. If you wanted to do that, say, once/second, it might just work.

0 Likes

#4

Thanks! This is what I was wondering. I didn’t think the API had anything to control colors of specific blocks of text so any plugin would have to do this syntax file rewriting/reloading. Good to know.

0 Likes

#5

Appears to be a thing? github.com/mazurov/sublime-levels

0 Likes

#6

go get my plugin or in package control as Colorcoder :smiling_imp:

AAAAALSO what does one need to do to get his password reseted in this place? :imp:

0 Likes

#7

You need to threaten Jon to implement an email server so that the server can send out password reset mails, I guess.

0 Likes

#8

Colorcoder is good !

0 Likes

#9

While this thread seems to be about how to achieve this in Sublime, I would like hear opinions on if this is a great idea or not. Spontaneously it seems interesting and logical idea. But…

when I try to read the code in the rainbow coloured samples I find them slightly hurtful to my eyes. IMHO you do not always look for every identifier in the code, you look for one. So you select it and every instance of that gets highlighted. Much more readable (to me) and we already have it in our editor. : )

0 Likes

#10

I think the biggest benefit would be to spot certain typos more readily without having to select something first. I also think this type of highlighting would work well on top of a more neutral color scheme for the regular syntax stuff we’re already used to. I’ve thought about experimenting with that but for now I’m going to see how semantic highlighting feels for a few days.

0 Likes

#11

true when the colors are too bright and interfere with other theme colors, i for one disabled any keyword highlighting and dimmed the colors a bit. one could also reduce the saturation to be just a tint apart from normal text color.

biggest benefit i see is one develops a feel for the data flow, kinda hard to explain but you start to watch for color patterns which is easier than looking for words

0 Likes

#12

For me, the best is to have syntax highlighting in general (for the whole file). Than having the possibility of selecting part of the code, for example one function, and change it to semantic highlighting for that part. In that case it is even possible to change the whole file to semantic highlighting by selecting the whole file. This would give us all in one!

0 Likes

#13

i could do this, placing it onto roadmap for somewhen

0 Likes

#14

Colorcoder is very impressive.
I found on my system I had to adjust the shading number to 0.6 0.44, but now it’s nice.

Is there a way to use Colorcoder with GoSublime?
I’ve set the default for .go files to go (Colorcoder),** is there a GoSublime (Colorcoder**) ?

0 Likes

#15

Nope but you can add the support yourself and send a pull request. I got somewhat little time atm to add colorcoder support to most languages, also i am not that good in tmLanguage magic

0 Likes

#16

Installation of ColorCoder just rendered my ST3 unresponsive. Had to kill it. But after restart it seems to work (I’m Pythonista)

0 Likes

#17

Nope. Just had this popping up:

so I guess it’s not ready yet for production.

0 Likes