Questions tagged [syntax-highlighting]

Syntax highlighting is a feature of some text editors that display text (especially source code) in different colors and fonts according to the category of terms.

Syntax highlighting is a feature of some text editors that display text (especially source code) in different colors and fonts according to the category of terms. For example, any given language will have certain repeating elements like strings, variables, functions or other keywords that can be color-coded to improve readability. It is used to identify syntax errors in the code and to make reading the code more visually appealing.

3594 questions
109
votes
13 answers

Syntax highlighting code with Javascript

What Javascript libraries can you recommend for syntax highlighting blocks in HTML? (One suggestion per answer please).
mlambie
  • 7,467
  • 6
  • 34
  • 41
107
votes
9 answers

How to change font color for comments in Vim

I'd like to change the default font color for comments, which is dark blue to slightly yellow color. It is difficult to read on the black background. I'm using xfce4-terminal, not gvim with GUI. How do I change only this one color? So far, I have…
xralf
  • 3,312
  • 45
  • 129
  • 200
103
votes
5 answers

syntax highlighting for react code in sublime

I'm started writing some basic React code in sublime text. Here is what my syntax highlighting looks like. Its partly highlighted. Is there any suggested sublime plugin i can use to see a complete syntax highlight? import React, { Component } from…
noi.m
  • 3,070
  • 5
  • 34
  • 57
102
votes
8 answers

How can I enable auto complete support in Notepad++?

I am trying to add simple syntax highlighting and auto completion for a simple scripting language... I added syntax highlighting using this article Now I want to know how to enable auto completion with Notepad ++ for my custom language. Does anyone…
Chathuranga Chandrasekara
  • 20,548
  • 30
  • 97
  • 138
98
votes
7 answers

Vim, how to reload syntax highlighting

When I execute Rmodel, Rcontroller and others in Vim. I see only white text. But when I go to next buffer and then go back by :bn and :bl, colors are working. This is my .vim folder https://github.com/regedarek/dotvim
tomekfranek
  • 6,852
  • 8
  • 45
  • 80
97
votes
5 answers

Change / Add syntax highlighting for a language in Sublime 2/3

I want to change / add syntax highlighting for a language in Sublime 2/3. For example I want the keyword this colored in JavaScript. How can I do that? I know that there is a preference JavaScript File in C:\Program Files\Sublime Text 3\Packages,…
Niklas
  • 23,674
  • 33
  • 131
  • 170
96
votes
10 answers

Eclipse syntax highlighting preferences save and restore

I spend some time customizing the colors for syntax highlighting in Eclipse (Java, JSP, HTML, CSS, etc.) but whenever I try to export these settings via File|Export|General|Preferences and reimport them, the settings never completely get imported…
foxdonut
  • 7,779
  • 7
  • 34
  • 33
90
votes
13 answers

How to highlight Bash scripts in Vim?

My Vim editor auto highlights PHP files (vim file.php), HTML files (vim file.html) and so on. But when I type: vim file and inside it write a Bash script, it doesn't highlight it. How can I tell Vim to highlight it as a Bash script? I start typing…
never_had_a_name
  • 90,630
  • 105
  • 267
  • 383
80
votes
15 answers

Xcode: code loses syntax coloring

I find that in various situations Objective-C code in Xcode 3.1 (Leopard) can fail to get appropriate syntax coloring after typing or lose coloring that it had. This isn't just a "refresh" issue with new custom symbols -- but affects Cocoa framework…
ColorMeFamous
  • 801
  • 1
  • 7
  • 3
76
votes
11 answers

class & function names highlighting in Vim

I just recently set up my Vim environment from Textmate, after becoming addicted to its modal input. However, syntax highlighting seems to be not so beautiful in Vim. I code in C++ and since the function call and class names can't be highlighted,…
75
votes
23 answers

Xcode code sense color/completion not working

EDIT: This is weird... if I double-click the Recent Projects item for the project in the welcome screen, code sense and coloring works just fine but if I just click Open (bottom right in welcome screen) it doesn't. Opening from File > Recent…
mga
  • 1,960
  • 1
  • 23
  • 31
75
votes
6 answers

Is Crockford style Context Coloring implemented in any code editor?

I watched a video from YUIConf 2012 in which Douglas Crockford gives a talk about implementing monads in JavaScript. In this talk he gives a code example that utilizes what he calls "Context Coloring" which throws out the idea of coloring by…
cs_brandt
  • 1,157
  • 1
  • 10
  • 15
72
votes
5 answers

Change Emacs syntax highlighting colors

I'm running Emacs, editing files in C++ mode and PHP mode. I love syntax highlighting as a concept, but the default colors are a travesty. I can barely read some of them: way too dark. What is the easiest way to change their values? I can't seem to…
adum
  • 2,890
  • 3
  • 25
  • 30
71
votes
6 answers

Pycharm utils.py not getting syntax highlight

I have several django projects and several different files with name utils.py, however pycharm treats them as simple .txt files with no syntax highlighting or any other kind of parsing, how can I fix this?
Vaibhav Mishra
  • 11,384
  • 12
  • 45
  • 58
71
votes
3 answers

How do I set up a syntax highlighter on Blogger?

How do I set up a syntax highlighter on Blogger's new interface? I did try with many options but nothing has worked. Please give any suggestions.
Anil
  • 935
  • 1
  • 8
  • 8