Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [syntax-highlighting]

Syntax highlighting is a feature of text editors that displays text, especially source code, in different colors and fonts according to the category of terms.

2
votes
3answers
4k views

How to print code from GitHub.com with its syntax-highlighting?

How can one print just the syntax highlighted source code from a GitHub source code page (e.g.)? I've tried it with a few browsers (Safari, Firefox, both running on OS X) but I have not succeeded in ...
13
votes
3answers
21k views

Better syntax highlighting for Java in Vim?

I've found Vim to have fantastic syntax highlighting with my preferred color schemes for Ruby and Python, but whenever I need to write Java code, it's like I haven't even turned on highlighting in the ...
0
votes
1answer
47 views

How to avoid syntax-highlight issue with backtick escape sequences inside a template literal?

Notepad++ has an issue where it breaks the syntax-highlighting when using a backtick escape sequence inside a template literal. It doesn't happen when escaping a single quote in a single quote string ...
1
vote
0answers
22 views

How do I hide empyy lines in a Python file in Vim?

I have some empty lines showing as dark purple lines in my color theme in vim(Gvim). I would like to hide them for real. I use "set list" but that just replaces with some other characters. I just ...
7
votes
2answers
2k views

Highlighting command line in vim

Is it possible to change the coloring for the command line in vim? I realize that may be somewhat ambiguously stated, so I have some things that should clear it up a little. This image illustrates ...
6
votes
2answers
8k views

Syntax highlighting in Terminal Mac OS X

How can I highlight different parts in the Mac OS X Terminal app? For example a different color for input and output? Are the pre-defined color themes I can activate/download?
0
votes
0answers
6 views

Auto highlight a custom syntax in cmd [duplicate]

I am trying highlight a syntax in cmd automatically when typing. Like in: C:\Users\User>echo "Hello" "Hello" C:\Users\User> In above command (echo "Hello") , I would like to change the color ...
0
votes
0answers
53 views

Syntax highlighting for PowerShell on Linux?

With PowerShell on Linux (pwsh), is there a way to get syntax highlighting on the console in the same way that it works by default in the Windows console?
22
votes
1answer
4k views

Pipe to less but keep the highlighting

Is it possible to pipe output (e.g. dmesg) to a command like less (or equivalent) and keep the text highlighting used by the original command? example: on the left dmesg | less on the right dmesg
0
votes
1answer
53 views

How to remove a limit of 100kB when highlighting a file with custom syntax?

I have created a custom syntax file for Smalltalk/X - smalltalk embedded with C. The highlighting file is mostly correct (still needs some love, but that is out of the scope of this question). I ...
124
votes
15answers
52k views

How to syntax highlight via Less

is there a way to syntax highlight a file I see in Less? actually I'm using this command to open an xml file (and sometimes a series of them) less htmleditors/htmleditors_config.xml or less [...
2
votes
1answer
404 views

Syntax Highlighting Color of HereDoc in Shell Language

I need some help modifying the default syntax colors. I've already spent too much time trying to research how to change the following shell script default, please help me... ;-( Here's the way I don'...
9
votes
1answer
874 views

vim syntax highlight limited to 3000 chars

How do I allow vim to work its syntax highlight on lines longer than 3000 characters? I am having to write tests for a system and the input for the tests are a mess of encapsulated formats. My tests ...
0
votes
0answers
22 views

IntelliJ: How to turn off highlights of class, method names

How can I turn off the highlights on import statements class names method names (signature and calls) things such as @Test ?
0
votes
2answers
136 views

Notepad++ with “sub levels” [duplicate]

I am writing HTML in Notepad++, but I did not find a way of making it more organized. I want, for example, that "head" is more to the right than "html". Example: Notepad++ is like: And i want it to ...
0
votes
0answers
32 views

Atom.io | How to edit CSON file

I am trying to edit my language-php/grammars/php.cson file in order to resolve an issue with syntax highlighting. However, I cannot seem to find this on my Windows installation of Atom.io ... It is ...
0
votes
0answers
79 views

How do I get Atom.io to properly color SQL when inside a PHP string?

Am I missing some package to correct this? At times, it works correctly ... Sometimes it does not work correctly ..
2
votes
1answer
1k views

How to get vim syntax highlighting to work?

I cannot get vim syntax highlighting to work on a suse box. I have (only this two lines) in my ~/.vimrc filetype plugin on syntax on If I open a shell script with .sh an do :set filetype? I get ...
0
votes
1answer
291 views

Babel syntax highlighting for React not working?

I've installed the Babel package in Sublime Text 3 (I see it in Preferences -> Package Settings), but the syntax highlighting for a sample App.js still looks weird: For example, I would expect the ...
0
votes
0answers
16 views

Change style for extensions that already have a style in Notepad++ [duplicate]

I've already tried the answers from here and here and neither fixed my problem. In Notepad++ using the Obsidian theme, the syntax highlighting for JSON files disappears; everything is white on black. ...
266
votes
2answers
104k views

Assigning custom extensions to a language's syntax highlighting in Notepad++

In the current version of Notepad++ opening .sql files results in Notepad applying SQL syntax highlighting to it. I'd like Notepad++ to do the same for other extensions as well, is there some setting ...
0
votes
1answer
261 views

How to configure Sublime Text 2?

So I want my Sublime Text 2 to look like this. To that end, I installed the corresponding theme and font (DejaVuSansMono). But no matter what I do, a/ the font doesn't change to what I want it to ...
0
votes
0answers
85 views

Visual Studio - refresh syntax highlighting

I'm using Visual Studio to develop Python applications. Everything works well, but syntax highlighting sometimes just goes wrong. For example: classes. < purple, including dot which should be ...
6
votes
3answers
904 views

Sublime Text 3 - Detect syntax based on file header

How would I get Sublime Text 3 to recognize file type (i.e. set syntax and build system) based on a files header? For example: If the first line of a file was <!DOCTYPE html>, it would be ...
1
vote
1answer
240 views

vim not picking up new syntax files

I copied this GLSL syntax file to /usr/share/vim/vim74/syntax/glsl.vim, its permissions are -rw-r--r-- same as other syntax files. I gvim /tmp/x.glsl but it does not activate GLSL syntax highlighting ...
0
votes
1answer
144 views

SublimeText highlighting for plain text

Sublime has highlighting plugins for almost any language, however often i use raw text format to write down some ongoing notes. When the content gets big enough it is useful to have some ...
2
votes
1answer
535 views

How to edit/change/modify the Syntax Highlighting Color in VS Code

How to edit/change/modify the Syntax Highlighting Color in VS Code, ie for Autohotkey and/or Markdown languages? For example: Im using the High Contrast theme (black background), and in that theme, ...
1
vote
3answers
1k views

Custom Vim Highlighting (only works with specific file types)

I have this in my vimrc: "on will override defaults set. Enable will allow you to set defaults." syntax enable ... "attempting to highlight specific keywords so it is easy to see in code." "see ...
1
vote
1answer
42 views

How can I change certain keywords in vim to all-caps?

How can I change certain keywords in vim to all-caps? I would like to know as I am programming in Fortran and the required style is to have all the intrinsic functions in caps. For example the keyword ...
1
vote
1answer
227 views

Vim highlight all text after multiple “#”

I am trying to make text bold if it appears after a series of # hashes. This is the line in my .vimrc: au BufRead,BufNewFile *.txt hi header cterm=cyan ctermbg=red and my attempted regular ...
2
votes
0answers
505 views

Sublime Text: Why regex in syntax highlighting does not work?

In Sublime Text 3, a default syntax highlighting rule paints a SQL SELECT just fine if it's in the same line, but not if it's in the next line: vs After reading this question I opened the PHP ...
4
votes
1answer
92 views

How can I disable vim's textwidth for specific lines?

I have textwidth set to 80 characters, and I have it set to 75 characters for gitcommit files. The thing is, the git commits at my company always have a last line that indicates some metadata about ...
1
vote
0answers
620 views

In Notepad++ how can I use the Style Configurator to change my user-defined language?

I've created a user-defined language for Notepad++, including all the syntax styling. It works well. (It's actually for Markdown, FWIW.) I coded all the colors into the style when I made it. The ...
1
vote
0answers
129 views

syntax highlighting breaks off on vim as you page up/down (on OSX terminal and iterm2)

This is a weird bug the problem is the syntax highlighting (say zenburn) on vim randomly appears and disappears as I page up and down (using ctrlu and ctrld).. for example compare these two renders ...
0
votes
1answer
523 views

Sublime match if endif block

Is there a way in sublimetext3 (by any plugins) to jump from start of an if block to corresponding endif? Using fortran code. Any other action besides jumping would work as well, like highlight or ...
0
votes
0answers
63 views

Is the coderay syntax-highlighting plugin built into redmine, or does it have to be installed separately?

I have installed a recent version of redmine - 3.3.3 but there is no syntax highlighting plugin included in the default installation. Most redmine searches mention coderay. Is that something I have ...
14
votes
5answers
7k views

How to change the syntax highlighting style in Meld

Meld 1.5.1 uses gtksourceview (via pygtksourceview) for its syntax-highlighting, however I'm unable to figure out how to configure it to use a specific style (color scheme/theme) from the ones ...
3
votes
1answer
986 views

Notepad++ Syntax Highlight: How can I set a delimiter with spaces?

I'm creating my User Define Language in notepad++, and I have a delimiter set like this: open: try escape: close: : But when I type entry, the try gets highlighted, as the delimiter I've set. How ...
2
votes
1answer
2k views

How to enhance Notepad++ to support Laravel blade syntax highlighting in a PHP file?

After looking online I cannot find any info on enhancing N++ to support syntax highlighting for Laravel's Blade syntax (*.blade.php). Example: demo.blade.php <html> <head> &...
7
votes
3answers
9k views

How to make Visual Studio 2010 highlight identical, selected words in editor ?

I would like to enable (if it exists) an option in Visual Studio 2010 that would highlight the same identical words to the selected ones. There is a feature like this already implemented e.g. in ...
1
vote
1answer
23 views

In-document highlighting hint for Kate

Is it possible to provide a hint for Kate which highlighting to use for a given document (inside the document itself) so that I don't have to set it manually? If so, in which syntax?
2
votes
1answer
47 views

Dreamweaver: Auto-correct

In Notepad++ when you type a wrong tag or a wrong word, the color will stay black instead of blue. How do you set up this preference in Dreamweaver CC? Thanks.
1
vote
2answers
1k views

How To Enable Syntax Highlighting for Nano In Windows?

I am a huge fan of the nano editor, but I can't get the syntax highlighting to work in the windows version. Is it possible to have syntax highlighting in windows?
1
vote
1answer
63 views

Finding source of Vim syntax highlighting

I have installed Vim 8.0 on my Windows 7 and Windows 10 machines. When I edit a text file using restructured text (with a .txt extension) and use :set ft=rst, syntax highlighting starts up as expected....
1
vote
1answer
745 views

Detect language of new files in vim (refresh syntax highlighting)

Whenever you open a file, vim performs a series of checks to determine the language of the file and applies the relevant syntax highlighting; first by checking the file extension, then by looking ...
2
votes
2answers
379 views

How to set syntax enable permanently in Vim

How do I make Vim to remember the syntax enable (or syntax on) command, so I don't have to type it every time I open a new file?
3
votes
3answers
2k views

In Vim how I can set a local match only for a specific filetype?

In Vim I can set local configuration as: setlocal number How I can set a local match only for a specific filetype? I use this: autocmd! BufEnter *.py,.vimrc,*.sh,*.c* :match ColorColumn /\%>...
2
votes
1answer
238 views

SublimeText Markdown Extended add Roman Number Highlighting

In this question, I've inquired about how to highlight more than one markdown list punctuation item. I now want to extend the highlighting to roman numbers as well, because those are supported by ...
0
votes
1answer
770 views

SecureCRT and Nice PHP/JS Syntax Highlighting: How To Configure?

I'm running SecureCRT using Windows 7. After googling a bit the VanDyke results came up, but I want to get it so instead of just a black background with all green text (sure it's better than the ...
0
votes
2answers
2k views

objective-c syntax highlighting for vim

I would like to have an excellent syntax highliter for obj-c that matches or beats the one in my xcode.. I've installed base16 through yadr, and i've also installed cocoa.vim to have better syntax ...