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.
320
questions
311
votes
3
answers
129k
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 ...
181
votes
17
answers
94k
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 [...
175
votes
1
answer
119k
views
How do I get Notepad++ to associate a file type with a language? [duplicate]
I have associated .wxs files with Notepad++. So far so good. However, it doesn't remember that it should use XML syntax highlighting. How do I associate a file-type with a Language?
67
votes
3
answers
57k
views
Is there any way to get bash to have syntax highlighting like fish?
In the fish shell, the actual command line is syntax highlighted:
Is there any way to get this same behavior in bash?
There is something just like this but for zsh, not bash. Is it possible that ...
48
votes
3
answers
15k
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
36
votes
2
answers
33k
views
creating a simple vim syntax highlighting
i have a simple sort of a database file which consists only of entries in the following format
variable=value
i want to create a simple vim syntax highlighting for it and set it for specific file ...
36
votes
3
answers
70k
views
Syntax highlighting in Microsoft Office Word [duplicate]
Possible Duplicate:
How do I easily highlight the syntax of PHP code in Word?
I need to paste some code (ANSI C) in Microsoft Office Word, and I need some form of syntax highlighting (instead of ...
34
votes
10
answers
27k
views
How do I easily highlight the syntax of PHP code in Word?
How do I easily write and syntax-highlighted PHP code (or any others programming language) in a Word 2009 document?
25
votes
6
answers
15k
views
Is there any *good* HTML-mode for emacs?
I love emacs,
and I want to do my web-programming work in it,
but I can't find a way to get it to edit HTML properly.
I mean it's seriously awful.
It will do HTML fine, but not PHP, javascript, etc....
24
votes
5
answers
10k
views
How can I highlight XML on the command line?
How can I highlight XML from stdin (e.g. piped from xmllint --format) to stdout?
I know how to get highlighting working in nano and view, but is there something that just outputs to stdout and exits?
...
22
votes
5
answers
10k
views
Is there any way to change Bitbucket code highlighting
I like the code coloring in Github so that keywords gets highlighted when view source code.
But in Bitbucket i see very light color and almost no diff between codes , keywords etc.
very bad color ...
22
votes
2
answers
8k
views
Convert HTML to image
Background
Batch convert various syntax-highlighted source files (C, SQL, Java, PHP, batch, bash) into high-resolution images (600dpi), suitable for an eBook and printed book.
Failed Solutions
A ...
21
votes
4
answers
9k
views
How do I enable syntax highlighting for .bash_aliases in vim?
I'm working on reorganizing my .bashrc. I moved my aliases to .bash_aliases (which is sourced by .bashrc, but I can't figure out how to enable syntax highlighting for this file. vim seems unable to ...
20
votes
3
answers
14k
views
Different language syntax highlighting within same file
I'm trying to get simple syntax highlighting working within a file. Here's the setup.
I have an index.php file, which Notepad++ correctly highlights any PHP code between the <? and ?> tags. ...
19
votes
4
answers
12k
views
Where can I find a gallery of Pygments CSS files [closed]
I googled every possible combination but I couldn't find a list of syntax files. Is there a list of good ones?
19
votes
4
answers
20k
views
Vim highlighting for specific file types (where to put syntax files, vim events, line to put into vimrc)
I have defined a file time jak.vim to offer custom highlighting when I take notes, however it is being applied to some files that do not have the .jak extension. Specifically a file named progress....
19
votes
3
answers
33k
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 ...
18
votes
2
answers
8k
views
Turn off syntax highlighting in Markdown code blocks (highlight.js underneath)
I am doing a presentation using Marp. It automatically adds syntax coloring to blocks of code. For example this would be colored as Ruby:
```
def fun(x):
x+1
end
```
I can force highlight.js to ...
18
votes
3
answers
5k
views
How to interrupt emacs when control-g does not work in very large files?
I've run into some kind of O(n^2) or worse behavior when viewing very large (e.g. 128MB) files in Emacs and jumping to the end of the file. I think it may have to do with my coloring algorithm to ...
17
votes
5
answers
14k
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 ...
16
votes
1
answer
3k
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 ...
15
votes
6
answers
18k
views
Custom vim highlighting
I am editing some xml right now and I have been leaving myself some comments of things to come back to. Like this
<!-- Question: bla bla -->
I am editing with vim right now and I would like ...
15
votes
2
answers
5k
views
Vim: How to change the current item highlight color when substituting
I have changed my Vim colours so when I do a /search, every match is highlighted in bright yellow. This makes matches much easier to see.
However, when I perform a substitution with the confirm flag ...
15
votes
2
answers
9k
views
Is there a way to have syntax highlighting or code blocks with Evernote?
How do you take notes on code snippets and or command line sequences in Evernote (Mac or PC)? Is there a way to have code blocks like the 'Code Sample' buttons here:
example
Any way to have colored ...
14
votes
6
answers
6k
views
Color coded Windows 7 Preview Pane?
Customizing what files you can preview is cool, but is there a way to create a custom preview extension to add syntax highlighting? I have many .h, .c, .cpp, .cs and .java files on my windows machine ...
12
votes
3
answers
23k
views
How do I make vim automatically apply c++ syntax highlight on Arduino files (.ino/.pde)?
How do I make vim automatically apply c++ syntax highlight on Arduino files (.ino/.pde)?
Or how does vim syntax highlight know what is a c++ file? And how can I tell him that files that is called ....
12
votes
3
answers
9k
views
Turning on XML syntax highlighting in vim for a non-XML file
I'm using vim to browse through some log files (the file extension is .log) which contain a lot of XML.
How can I turn on XML syntax highlighting after opening the file? Of course, I don't actually ...
12
votes
1
answer
9k
views
notepad++ - Applying CSS styles for SCSS files?
In Notepad++, I have some SCSS files for which I would like the syntax to be highlighted like CSS files are. How do I do this in Notepad++?
In other words, I would like to apply the same styles to ...
12
votes
1
answer
36k
views
How can I copy text with syntax-highlighting from Notepad++? [duplicate]
I have an XML snippet in Notepad++ that I would like to share with a co-worker via email. In Notepad++ the syntax highlighting nicely shows off the elements and attributes. Here is a sample picture:
...
12
votes
1
answer
5k
views
Foldable/collapsable notepad++ markdown syntax
I am using Notepad++ for writing texts using Markdown syntax.
I know there exists at least one Notepad++ style file to hightlight Markdows texts (see MultiMarkdown in Notepad ++ and https://github....
12
votes
1
answer
4k
views
Is it possible Notepad++ to change the theme based on current filetype
For example, if I open a text file, notepad++ would open it in 'default' theme. But if I open a php file for instance, it would open it in 'custom_theme1'. I know notepad++ is highly extensible, so I ...
11
votes
1
answer
13k
views
How to get syntax highlighting working in TextMate 2
I just cloned TextMate 2 from GitHub. Followed the instructions in the readme file and everything went smooth with the installation. However, there is no syntax highlighting.
No problem – just need ...
11
votes
1
answer
9k
views
how to turn off gvim error highlighting?
I use gvim as my text editor and the syntax coloring is great except it highlights "errors" and gives it a white background with red font. How do I turn off error highlighting? I find it annoying and ...
11
votes
2
answers
29k
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?
10
votes
1
answer
5k
views
Modifying a gedit syntax highlighting file
I am trying to change a highlighting file from Gedit. I have modified the file /usr/share/gtksourceview-3.0/language-specs/fortran.lang because I want to change the cases in which the editor takes a ...
9
votes
1
answer
5k
views
How to change syntax for a specific folder in Sublime Text 3
I write JS projects in ES5 and ES6. I installed Babel-Sublime for highlighting Babel supported code. Now, I open a .js file written in ES6, goto "View -> syntax -> Open all with current extension as : ...
9
votes
3
answers
8k
views
How to I use Textmate color themes with vim?
I have a textmate color theme I really like this,
But I am a hardcore vim user. Is there an easy (painless) way for me to use this color scheme with vim?
9
votes
2
answers
6k
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 ...
9
votes
2
answers
3k
views
How do I change the hilighted length of git commit-messages in vim?
I'm of the opinion that the orthodox 50-character limit on git commit messages is absolutely ridiculous. (Primarily because I think using an 80-character wide Terminal in 2015 is equally ridiculous.) :...
9
votes
2
answers
2k
views
Multiple foldmethods in vim
I use the folding option of vim quite a lot, and have usually set foldmethod to syntax. Recently I discovered that it is possible to add custom folds, such that I can put whole blocks in /*{{{*/ and /*...
9
votes
1
answer
4k
views
How to have VIM show unclosed parenthesis?
Is there a way that I can change my .vimrc file so that unclosed parenthesis/brackets/braces are highlighted?
For instance the following would highlight the parenthesis after the word main:
public ...
8
votes
1
answer
17k
views
How to syntax highlight python scripts in PHP storm
I tried installing this script but then got this error message:
I'm hoping for an answer that's similar to this one but for python instead of ruby.
8
votes
2
answers
5k
views
How to get Sublime Text 3 to automatically highlight CSHTML as HTML
I have a bunch of .CSHTML files that I want to be highlighted. Every time I open a .CSHTML file I have to go to the bottom right of the sublime text window and manually tell it to treat the CSHTML as ...
8
votes
2
answers
9k
views
How can I highlight .htaccess code in Notepad++?
How can I highlight .htaccess code?
I downloaded this XML file and I copy and pasted file content to userDefinedLanguage.xml inside my install directory.
According to the documentation found here I ...
8
votes
2
answers
2k
views
Slowness in Vim's bracket-matching with the default PHP syntax
I am experiencing a noticeable slowness in Vim's bracket-matching and -highlighting feature. When the cursor is placed over a parenthesis or bracket, there is a delay of about 300ms on the console's ...
8
votes
4
answers
2k
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 ...
8
votes
3
answers
5k
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 ...
8
votes
2
answers
2k
views
Toggle Syntax highlighting in Notepad++
I am running into speed-issues for big files, whose extension is recognized by Notepad++ which will be syntax-highlighted.
Is there a Shortcut or option to assign keys to toggle Syntax-Highlighting in ...
8
votes
1
answer
3k
views
How can I configure syntax highlighting for a custom language in vim?
We use our own little language for small tasks, but we do not have Vim highlighting support for it.
8
votes
1
answer
13k
views
How do I create my custom "User-Defined" language in Notepad++?
In Notepad++ there is a menu option: Language->"User-Defined".
How do I customize that? What are capabilities of such option?
Can I highlight date/time? Can I highlight 21-29th symbols in the lines?...