DEV Community

Huy Tr.
Huy Tr.

Posted on

Turning off the syntax highlighter

Well... first of all, this is a well-known topic that widely discussed everywhere already.

So I started turning off my Vim's syntax color from May this year, it's 5 months already.

There some real benefits for it that I can confirmed now:'

  • Getting more focus on the work, that mean, more productivity
  • Read/understand the code better, and even faster
  • Vim run faster as well
  • Being way more cooler, my colleagues now look at me as a guy from Mars

Is there anyone doing the same thing?

P/S: This is the color scheme I'm using for my vim https://gist.github.com/huytd/8394f21bda3a08be025813c060d64e75

Top comments (32)

Collapse
 
codemouse92 profile image
Jason C. McDonald

Won't venture to disagree with others' results, but turning off syntax highlighting would be detrimental to me. Due to my dyslexia, I rely on it heavily to help me visually parse code, and catch typos early.

Collapse
 
prodigalknight profile image
RevanProdigalKnight

I'm not dyslexic, but I also find that syntax highlighting helps me catch typos early. The more distinctly colored different segments of text are, the better, in my opinion.

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

Well, at least you have good taste in music! :)

Collapse
 
patricktingen profile image
Patrick Tingen • Edited

To each its own of course, but for the life of me I cannot imagine why I would want to turn off syntax highlighting. If it helps you being more productive and understand code better, then please continue, but it's not for me.

With highlighting, I can easier understand the structure of sentences in the source. Keywords stand out and I can quickly scan the code for the parts I am interested in. If I suspect something is wrong in the definitions I scroll up until the color of the code tells me I am in the definition part of the source. If I make a typo, the words don't color so it tells me I made an error so I would not want to live without it. To me syntax highlighting is the best thing since sliced bread.

Collapse
 
patricktingen profile image
Patrick Tingen

On second thought - and clicking through some of the linked posts - I must add that I am using a scheme with few colors:

Example

Collapse
 
gsonderby profile image
Gert Sønderby

Last time I didn't have any syntax highlighting while coding, it was C64 BASIC, and I was 10. I have generally seen my code improve and my errors be easier to find as the degree of syntax assist tooling I've used has increased. Today, I use (all hooked into Atom) prettier, eslint, and syntax highlighting (Nord theme)... Not a whole lot of syntax errors go undetected.

So to me, this would be catastrophic advice.

Collapse
 
kjocevicius profile image
Karolis Jocevičius • Edited

I think, with code highlighting, you really need to evaluate what is being highlighted. Then you will suddenly notice that it doesn't really make sense to highlight everything.

For example Java keywords highlighting is not necessary - you can live with having them bold. Highlighting every code symbol (function, variable) also kinda misses the point. However knowing which variables are static and which are constants - is actually useful.

I don't think a developer should code without highlighting - that's a bad idea. But you should evaluate what highlighting you really need.

Collapse
 
moopet profile image
Ben Sinclair

Your screenshot includes bold keywords and dimmed comments, so I assume you're either rolling your own or using a minimal syntax highlighting scheme, rather than actually turning it off?

You say "Getting more focus on the work, that mean, more productivity" but the only coloured thing on your screen, which immediately grabs attention, is a clock and a song title, both of which are totally unrelated to work (unless you're coding a bot that writes metal...)

Collapse
 
totiiimon profile image
Totiimon

I'm trying this out. Also trying out VIM since I delayed it quite some time!

I'm curious about your status line style and that music playing thingy. Would you mind sharing it? I love the style of it :)

Collapse
 
huytd profile image
Huy Tr.

It's just a script to display current playing song on Spotify on Tmux status line. You can take a look at github.com/jdxcode/tmux-spotify-info

For the tmux, I made a config file public here gist.github.com/huytd/10e490955d34...

Collapse
 
brainwipe profile image
Rob Lang

How can you say:

Getting more focus on the work, that mean, more productivity
Read/understand the code better, and even faster

Without a parallel you working on the same thing over that period of time? This is bogus click bait.

Collapse
 
cmilr profile image
Cary Miller

Haha, I can’t believe some of these responses... seriously people? I learned to code long before syntax highlighting was a thing, and honestly, while I do use it today, I like a very tame color scheme for the most part. To me it seems like everyone should basically create their own theme, because we all think differently, and we all react to colors and other distractions differently.

Anyway, here’s to experimentation and exploration!

Collapse
 
chainq profile image
Károly Balogh

I worked a long time on various (exotic) platforms without effective or any syntax highlighting. I think it certainly makes you a better developer, in the sense of reading the code without aids, and taking assumptions of the editor (or any tool) you're using as granted. I could compare it to watching the movie vs. reading the book. You have to put in more effort, but it feels you just somehow get to a deeper understanding of the code.

Also, strictly speaking, your screenshot is not syntax highlighting off, it's just limited syntax highlighting. In most my cases, not even comments or language keywords were colored differently. ;)

I think every developer should try coding with highlighting off, if for nothing else then for an adventure and to stretch their limits. And it's good practice to reduce your dependency on your tools, just as good practice to keep your code's dependency to the minimum, if it's possible with reasonable effort. Otherwise it's just a matter of taste. At this point I can certainly switch back to not using syntax highlighting at all with a few hours of adjustment. But SOME syntax highlighting, just makes me more productive, I learned. And when you have work to do, that matters a lot.

Collapse
 
millebi profile image
Bill Miller

Ha! I never noticed how little syntax highlighting I was actually using until I read this post and then quickly looked at my editor screen. Being colour blind means that I'm not seeing a lot of the "additional" information being added, so the end result is that I have 3 colours in use (base, constants, and strings) with bold for keywords.

I personally would think that too many colour variations would become distracting and slow down coding because you have to remember what each colour means rather than understanding the actual text of the code. But that's just me.

Do whatever makes you more productive. Working code is more useful than "pretty" non-working text :D

Collapse
 
markisundefined profile image
Mark • Edited

First of all, it's a personal preference.

Whatever makes you more productive the better. Personally though, I'd prefer syntax highlighting over the other because unlike you, it allows me to read, understand and browse the code much faster.

Your vim setup looks amazing by the way!

Collapse
 
huytd profile image
Huy Tr.

I agree. It's just the matter of personal taste, and I tend to share my taste to find more people just like me (or hopefully convert someone's taste :P)

Collapse
 
defman profile image
Sergey Kislyakov

I could try to disable syntax highlighting but I doubt it will boost my productivity. Better tools will do, so I count syntax highlighting as a tool. I have a delay (1s) before the linter runs so sometimes I detect syntax errors faster because of syntax highlighting. It's easier to me to navigate in colorized code as well for some reason.

Collapse
 
pinotattari profile image
Riccardo Bernardini • Edited

This is the color scheme I use. I am curious to try without colors, but I need to change all the entries in the preferences and right now I am lazy... Maybe I'll try.

Reflecting a bit, I think that the most important highlighting for me are the keywords and the comments. I could definitively do without highlighting for strings and numbers and maybe type names too.

Collapse
 
asgaardson profile image
Ragnar Sorensen

Wait what? While I can't wait for JetBrains to implement MORE distinct with MORE options to highlight something, some people DELIBERATELY turn off the highlighting in their editors? And try to convince others that indistinct gray text on black background is better than highlighted, bright highlight on dark background?

Not only syntax highlighting helps to understand code fast: you rely more on color than on reading code to see the place in code you're looking for.
If color scheme of syntax highlighting HURTS your productivity, you should change both editor and colorscheme, because it's the real reason it does not work for you.