26 votes

Is there any way to get bash to have syntax highlighting like fish?

There is no simple way to obtain syntax highlighting in GNU Bash (or GNU Readline), but it is in principle possible to implement your own line editor in Bash script by binding all the user inputs to ...
akinomyoga's user avatar
24 votes

vim syntax highlight limited to 3000 chars

Use :set synmaxcol=0 to remove the limit or choose any large value. Warning: This setting may add a significant redraw delay. Vim documentation: options - synmaxcol 'synmaxcol' 'smc' number (...
Steven's user avatar
  • 27.9k
21 votes
Accepted

Turn off syntax highlighting in Markdown code blocks (highlight.js underneath)

According to this issue on GitHub it is possible and the keyword is text: ```text def fun(x): x+1 end ```
Mateusz Piotrowski's user avatar
12 votes
Accepted

How to get Sublime Text 3 to automatically highlight CSHTML as HTML

You can install the HTML (C#) via Package Control, that extends HTML highlighting for C#-specific tags and logic blocks. Historic Answer Open any .cshtml file In the main-menu, choose View > ...
idleberg's user avatar
  • 1,342
10 votes

Turn off syntax highlighting in Markdown code blocks (highlight.js underneath)

I found only plaintext to work: ```plaintext def fun(x): x+1 end ``` Source: https://highlightjs.org/static/demo/
Frederik Holm Strøm's user avatar
10 votes
Accepted

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

Here are 3 different ways you can do it: :set ft=python. The down side to this approach is that you can't add it to a keyboard shortcut since it will only work with one file type (python in this ...
KNejad's user avatar
  • 565
9 votes

Is there any way to change Bitbucket code highlighting

A Chrome extension called "Refined Bitbucket" provides the syntax highlighting you ask for: Install it from the Chrome web store and it will automatically make changes to BitBucket's Pull ...
Evans's user avatar
  • 91
7 votes

How can I highlight XML on the command line?

I use bat: xmllint --format - | bat -pP -p removes all decoration (line numbers, etc.), -P disables the pager. Update: use -pp with newer versions of bat. bat: https://github.com/sharkdp/bat
sebnukem's user avatar
  • 171
7 votes

Color coded Windows 7 Preview Pane?

I know the question is old. But just as other can benefit from my search I just found out a good preview handler. https://github.com/RRUZ/delphi-preview-handler It handles many types like c,c++,c#,....
rxantos's user avatar
  • 221
7 votes

Vim: How to change the current item highlight color when substituting

When inside vim you can use the command mode: :highlight IncSearch guibg=green ctermbg=green term=underline To have it always, put this into your .vimrc: highlight IncSearch guibg=green ctermbg=green ...
p1100i's user avatar
  • 990
7 votes

How can I highlight .htaccess code in Notepad++?

I wasn't sure exactly how to work this out. A little more searching and I dug up exactly what I was looking for. Notepad++ Apache httpd.conf .htaccess Syntax Highlighting Download http://notepad-...
Jarod Thornton's user avatar
6 votes

How to change the syntax highlighting style in Meld

In Meld 3.16.4 you can simply choose color scheme in Meld > Preferences: (possibly this change was introduced in earlier versions)
Tombart's user avatar
  • 1,635
5 votes
Accepted

Syntax Highlighting Color of HereDoc in Shell Language

The trick is that language Languages > Shell (for sh extension) is in Style Configurator presented as bash what can be misleading (and it was misleading for me), but it is really the same language. ...
miroxlav's user avatar
  • 13.5k
4 votes

Sublime Text 3 - Detect syntax based on file header

ApplySyntax plugin does handle cases, when you need different syntax for files with the same extension and many more.
Alexei Danchenkov's user avatar
4 votes

How to interrupt emacs when control-g does not work in very large files?

Here was my answer to a similar question which may help: https://stackoverflow.com/a/47070702/3818556 So far the only way I found ever working is to send a SIGUSR2 signal to the busy emacs process ...
Luke Lee's user avatar
  • 447
3 votes

Better syntax highlighting for Java in Vim?

It seems there simply isn't a rich syntax file out there. But we can squeeze a little bit more out of the bundled syntax file we have: let java_highlight_functions = 1 let java_highlight_all = 1 " ...
joeytwiddle's user avatar
  • 1,755
3 votes

How to syntax highlight via Less

I found highlight which: Supports multiple colour schemes and 256-colours Works on STDIN (unlike source-highlight) Is much faster than pygmentize Here is a script I call highlight-less-wrapper which ...
Tom Hale's user avatar
  • 2,420
3 votes
Accepted

SublimeText 3 Syntax Highlighting Markdown List Asterisk

You'll need to edit the Markdown Extended syntax definition file, which is locked up in a zipped .sublime-package archive, so first you'll need to install PackageResourceViewer. Once installed, open ...
MattDMo's user avatar
  • 5,329
3 votes
Accepted

Simple custom syntax in vim

Syntax script Create a file ~/.vim/syntax/vm.vim with the following contents: " Quit when a syntax file was already loaded. if exists('b:current_syntax') | finish| endif syntax match vmBackticks "`...
Ingo Karkat's user avatar
  • 23.1k
3 votes
Accepted

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

As a quick hack, you can adapt the 'textwidth' value whenever the cursor moves: :autocmd CursorMoved,CursorMovedI <buffer> let &l:textwidth = (getline('.') =~# '^\((patch)\|(minor)\|(major)\...
Ingo Karkat's user avatar
  • 23.1k
3 votes

Notepad++ COBOL Comment Highlighting with Line Numbers

I know this is an old post but maybe this will help someone. I recently started programming in Unisys COBOL and noticed the issue you are referring to. To fix it, you will need to rebuild NPP. It is ...
Paul Baker's user avatar
3 votes

Has anyone developed a Notepad++ Lexer for "begin/end" block languages like Verilog and Pascal?

Support for Pascal and Verilog The conclusion was syntax highlighting of code blocks in languages using begin / end instead of braces would require writing a custom Lexer According to Programming ...
DavidPostill's user avatar
  • 157k
2 votes

Syntax Highlighting in Terminal for Python?

You can try ptpython in github, simply pip install ptpython and use it with ptpython.
zyy's user avatar
  • 189
2 votes

eclipse .conf files coloring syntax (highlighting)

I used a coffee script plugin for eclipse to open the .conf file. It fulfills the requirement. Though I know that is not the standard way to do it. Edit 1 : Found another more suitable alternative. ...
nayak's user avatar
  • 121
2 votes

Vim syntax highlighting disappeared for text files (.txt)

Vim supports modelines. To force coloring the file as conf (erichui's answer), put the following line at the end or beginning of your file: # vim: syntax=conf This sets vim's internal variable ...
Scz's user avatar
  • 433
2 votes

yml file syntax highlighting with Sublime Text

There is currently a pull request to completely replace the old YAML syntax highlighting definition with a new one. I haven't tested it yet, so I don't know if your particular issue has been addressed,...
MattDMo's user avatar
  • 5,329
2 votes

Sublime Text 3 - Detect syntax based on file header

To expand on Gerard Roche's answer, if you're wondering how to find these syntax definition files in Sublime Text 3, I found this answer helpful. To summarize: on MacOS X, the package files live at /...
JeffP's user avatar
  • 121
2 votes

VIM does not detect syntax of .ssh/config

If you want ssh config syntax coloring for all files in ~/.ssh/config.d/ (or any other catalog you want) then use either solution A or B by @Shane Mulligan but put this line instead: au BufNewFile,...
Szymon Sadło's user avatar
2 votes
Accepted

Sublime Text 3 - Detect syntax based on file header

Syntax definitions have a first_line_match rule, for example: HTML: https://github.com/sublimehq/Packages/blob/master/HTML/HTML.sublime-syntax#L12 first_line_match: (?i)<(!DOCTYPE\s*)?html PHP: ...
Gerard Roche's user avatar
2 votes

Pipe to less but keep the highlighting

A generic command to preserve coloration independent of the program providing the output is the unbuffer command (which is part of the expect package). Usage: unbuffer dmesg | less -R
Artur Meinild's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible