Questions tagged [syntax-highlighting]

Questions about the feature of syntax-highlighting (where code structure is made visually prominent) in software such as text-editors and integrated development environments (ide).

Filter by
Sorted by
Tagged with
246 votes
15 answers
425k views

How do I enable syntax highlighting in nano?

Can nano do syntax highlighting like gedit and vim? How can I enable it? I need at least bash and python syntax highlights.
Oxwivi's user avatar
  • 17.9k
27 votes
4 answers
15k views

Can I set a default syntax highlighting in Gedit?

Until you save a document in gedit, syntax highlighting is turned off. There are obviously good reasons for this -- people might get confused if certain words were randomly showing up in different ...
Michael Martin-Smucker's user avatar
25 votes
2 answers
38k views

How do I add a syntax highlighter format to Gedit?

How can I add in the regular expressions for an additional syntax language?
700 Software's user avatar
  • 2,267
13 votes
1 answer
5k views

How to change the default highlighting of gedit for a specific extension

Everytime I open a .m file, gedit associates Octave highlighting to it. I would like to change the default behavior to Matlab. How can I, in general, change the default highlighting that gedit gives ...
adn's user avatar
  • 261
10 votes
2 answers
6k views

Is there syntax highlighting for psql?

Is there some setting or package that I could use to give syntax highlighting to psql (the PostgreSQL shell)?
tutuca's user avatar
  • 2,682
9 votes
1 answer
7k views

Create a custom syntax highlight in gedit

Following my question from long ago, I am still trying to tweak my fortune handling capabilities. The display in terminal is awesome, just one thing remains - syntax highlighting in Gedit as I add, ...
Parto's user avatar
  • 15.3k
7 votes
4 answers
11k views

How do I enable syntax highlighting for groovy in Vi?

I was using Fedora for about six months, and recently switched to Ubuntu. Here in Ubuntu, there is no code/syntax highlighting for groovy in Vi editor, which was actually there in Fedora Vi. How to ...
Ant's's user avatar
  • 3,890
7 votes
1 answer
603 views

Swift syntax highlighting in gedit?

I do not see an option for Swift highlighting in the gedit language menu. How can I get gedit to highlight Swift code for me?
taylor swift's user avatar
6 votes
1 answer
10k views

Syntax Highlighting vi editor [duplicate]

How to enable syntax highlighting features in vi editor ? I am currently using ubuntu 16.10. Here is the output of vi --version. VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 22:32:42) ...
Kaushal's user avatar
  • 73
6 votes
3 answers
18k views

How to set nano default syntax highlighting for files with no extension?

I'm trying to set a 'default' syntax highlighting scheme for nano when I'm editing files with no extension such as /etc/nginx/sites-available/default or /etc/ssh/sshd_config but I can't seem to make ...
AJB's user avatar
  • 187
5 votes
2 answers
3k views

How to use pygmentize automatically with less [duplicate]

I found pygmentize thanks to this answer, but it would be great if it could be used to highlight text with less or maybe replace the command. Is there a way to do that? Thanks in advance.
Alter Lagos's user avatar
  • 1,159
5 votes
2 answers
2k views

Syntax highlighting with less, trouble with lexer

I have installed python-pygments and using it for syntax highlighting with less as described by mankoff here I put a function in my .bashrc cless () { pygmentize -f terminal "$1" | less -R } it ...
sourav c.'s user avatar
  • 44.8k
5 votes
1 answer
7k views

How to add a new language definition for syntax highlighting in Gedit?

I've attempted to create a new .lang file for getting Gedit to recognize the Julia programming language. I have read the tutorial, the reference document and the wiki page Gedit/NewLanguage, and I ...
waldyrious's user avatar
  • 2,197
4 votes
2 answers
2k views

Creating Highlighted PDF from JSON

I have a JSON file and would like to create a pdf containing the pretty printed and syntax highlighted version of that JSON file. Is there any way to do that in Ubuntu?
MajorYel's user avatar
4 votes
1 answer
3k views

How to add support of scala syntax highlighting in VIM?

How to configure VIM to be able to highlight scala language (.scala files extension)? Current VIM configuration (.vimrc file): :syntax on
Denis Kuzin's user avatar
4 votes
1 answer
1k views

How can I tell Gedit which syntax highlighting to apply?

For some godforsaken reason, Twig files in our source code are saved with a .html extension, instead of a .twig extension. I followed guidelines to add custom highlighting to Gedit, and the Twig ...
TRiG's user avatar
  • 1,910
4 votes
1 answer
1k views

Highlight search results in GNOME Terminal?

Is there a way/plugin to highlight the searched strings in GNOME Terminal on Ubuntu (When using Ctrl+F or similar keys)? Not just a single result, but all which appear inside the window?
valk's user avatar
  • 417
4 votes
1 answer
2k views

How to get QML syntax highlighting in gedit?

QML files opened with gedit don't have syntax highlighting. Is there a package providing a gtksourceview lang.spec file for QML? If not, has anyone written a lang.spec than can be installed locally?
andrewsomething's user avatar
3 votes
1 answer
13k views

How to change syntax color in vim? [duplicate]

I have Ubuntu 16.04 LTS. But vim is not showing the proper syntax colors and also the mode in which you are like insert mode. So can anyone help me how to solve the issue?
Suraj kumar's user avatar
3 votes
1 answer
4k views

How do I get terminator to use syntax highlighting?

When sifting through large amounts of input and output in my terminal emulator (terminator in this case) it would come in handy if I had some syntax highlighting available to make things more readable....
Josh Pinto's user avatar
  • 7,919
3 votes
2 answers
291 views

Is there a graphical pager with syntax highlighting?

Is there a graphical application in the repositories which has keyboard controls like the command-line application "less" and also has syntax highlighting? I would like it to have arrow keys that ...
nlognfan's user avatar
3 votes
1 answer
782 views

In Nano is there a way to have nanorc settings apply to just one filetype/syntax?

Background: To enable Nano's syntax highlighting I have configured various shared .nanorc files with the format /usr/share/nano/*.nanorc, eg /usr/share/nano/python.nanorc This works well but I keep ...
Neil's user avatar
  • 131
2 votes
3 answers
3k views

Nano syntax highlighting for C# and/or ASP.Net

Has anyone got (or can point in the direction of) a nanorc file that contains syntax highlighting for C# and/or ASP.Net?
Rob Cowell's user avatar
2 votes
1 answer
1k views

Why does Vim highlight Javadoc comments like this?

I am using vim to edit Java code. I added a Javadoc header above the class definition, but the syntax highlighting is very strange: read the Javadoc comment above Why is the first sentence ...
joshreesjones's user avatar
2 votes
1 answer
904 views

KDevelop and custom syntax coloring

I am currently trying out KDevelop 5.2.1 for a C++ project on Ubuntu 18 and so far, everything is working as expected, except syntax coloring. I have not been able to personalize it the way I want. ...
BobMorane's user avatar
  • 197
2 votes
1 answer
625 views

How can I add Markdown syntax highligting to Pluma in 16.04 LTS?

I'm using Pluma on Ubuntu MATE 16.04 LTS and I see that it does not support syntax highlighting for Markdown lightweight markup language. But I know that Ubuntu 18.04 LTS (and newer versions) have ...
N0rbert's user avatar
  • 100k
2 votes
1 answer
1k views

How to change the path to the folder of the XML syntax files? (gedit)

Any clue about the variable to be changed in order for gedit to read XML files in another folder? Currently syntax files are in: /usr/share/gtksourceview-2.0/language-specs I'd like gedit to read ...
Andrei's user avatar
  • 21
2 votes
2 answers
341 views

How to make geany or vi understand Maxima (or any other less known) syntax

I tend to program a lot in a symbolic language called Maxima, but I haven't found any editor that highlights its syntax. Is there I way I can make vi or geany (or whatever) understand this syntax and ...
TomCho's user avatar
  • 364
2 votes
2 answers
2k views

VIM does not detect syntax of .ssh/config

On a plain Ubuntu installation (12.04 in my case) when I have no ~/.vimrc VIM does not detect syntax of .ssh/config. Syntax highlighting works, but it does not set the correct filetype. vi ~/.ssh/...
Erik's user avatar
  • 151
2 votes
1 answer
1k views

Vi syntax highlighting for words followed by a parenthesis

I want to change the color of a keyword that is followed by a left parenthesis in a .R file. For instance, when I type length(), I want the word length to be highlighted (and not the parentheses), ...
mickwar's user avatar
  • 55
2 votes
0 answers
400 views

What's up with Gedit's HTML highlighting?

I've been learning some HTML code recently, and something weird is up with Gedit's highlighting. Whenever I try to use the <h3> tag, Gedit immediately cancels all the highlighting and the text ...
SyntheticHuman's user avatar
2 votes
0 answers
469 views

Colored syntax and terminal when using SSH from terminal

Ok. So I use pico as a text editor. In ubuntu and when I ssh using putty I have colored syntax and colored terminals. When I ssh through ubuntu terminal I have solid white text. I always ssh into my ...
DirtyDaver's user avatar
2 votes
0 answers
998 views

Is there a way to highlight a specific word in terminal?

I am using two switches that are very similar and I would like to colour each switch in a different colour. So that any time that I will write in the command line that word - it will automatic ...
yoni's user avatar
  • 21
2 votes
1 answer
494 views

gedit highlighting " CISCO IOS" can't find one

daily i 'm using gedit in order to configure Cisco devices is there someone who created a cisco highlighting language ??? can't find one .... and it is a loooong way creating one from scratch....
Eugenio Desideri's user avatar
1 vote
2 answers
760 views

Disable syntax highlighting in Geany

I am trying to turn off syntax highlighting in Geany. I tried commenting this out in filetype_extensions.conf. Sh=*.sh;configure;configure.in; As a temporary fix, I changed file extension of files ...
fixit7's user avatar
  • 3,127
1 vote
3 answers
7k views

Enable syntax coloring in Geany?

Online all the examples for Geany have syntax coloring, but I couldn't figure out how to enable this feature. I downloaded Geany, then created a new python file, but whenever as I type a keyword, ...
user2154420's user avatar
1 vote
1 answer
762 views

How can I print PHP syntax highlighting on a colour printer?

This must have been answered before, but I simply cannot find the answer either here or elsewhere. I edit a PHP file in gedit, which is all nicely coloured for syntax. But when I want to print it, ...
Paddy Landau's user avatar
  • 4,558
1 vote
1 answer
2k views

Gedit bash highlight

When I edit bash script(first line is #!/bin/bash) in GEdit, there is no highlighting. But with View->Highlight Mode, there is no result when searching "bash" or "script", which to choose?
jw_'s user avatar
  • 313
1 vote
1 answer
1k views

Create PostScript file from vim

How can I open a script file and automatic create the PostScript file? Now I use: vim file.py and inside :ha > text.ps. The problem is that the command have to go inside a bash script. How can I ...
Davide's user avatar
  • 113
1 vote
1 answer
473 views

vim syntax highlighting ubuntu touch

I'm trying to get syntax highlighting working while using vim. :version gives me: "Small version without GUI". I installed both "vim-gui-common" and "vim-runtime", but everytime I issue the command ...
Ciofeca999's user avatar
1 vote
1 answer
384 views

How to highlight Non-consecutive text in Gedit?

Is there any short-cut/keyboard command to highlight, i.e., select, non-consecutive text in gedit? For instance, say I want to highlight the words there and text in the previous sentence at the same ...
The Inquiring Robot's user avatar
1 vote
0 answers
492 views

syntax highlighting in vi changed after upgrading Ubuntu 16.04

First, read this question below: problem in terminal syntax highlighting It also changed the default syntax highlighting in terminal after upgrading UBUNTU. There is a difference between ver.14 and ...
Kwangil Cho's user avatar
1 vote
0 answers
255 views

How to add global syntax highlight in nano

I use nano as my text editor for development, so I would want trailing spaces to be highlighted. Right now I am just adding the line: color ,green "[[:space:]]+$" to all the files included on my ....
Min4Builder's user avatar
1 vote
1 answer
345 views

Gedit PHP syntax highlighting

Does anyone know how to fix this issue? I have PHP inline to HTML. There's an opening quotation and the inline PHP also has a quote, but Gedit thinks it's the closing quote for the HTML. Add this to ...
Vasilios Betoglou's user avatar
1 vote
1 answer
6k views

Change color scheme in Kate

I'm looking to change the color scheme in Kate to something else (e.g Solarized, Zenburn, etc). I tried the instructions found in Using “Oblivion” color scheme from Gedit in Kate, but nothing changed ...
Blue Ice's user avatar
  • 381
0 votes
1 answer
765 views

Is there a way to get Smarty syntax highlight in gedit?

I'm using smarty to develop a website and I need syntax highlighting. Currently gedit only highlights the html. Since my tpl files contains only html and smarty template functions. I've Google'd for ...
Alvar's user avatar
  • 17.1k
0 votes
1 answer
179 views

How to enable syntax highlighting in vi while using the global command?

Opening a file with vi nicely highlights its contents. However, I want to view the file with all lines containing clock_gettime hidden. By using the global command :g!/clock_gettime I get the ...
Snackoverflow's user avatar
0 votes
1 answer
146 views

Forcing gedit to recognize .kv files

On Ubuntu, the language that defines syntax highlighting for kivy layout files is installed by default (or added automatically when installing kivy). The problem is, in gedit, I have to manually ...
BLUC's user avatar
  • 167
0 votes
1 answer
232 views

IntelliJ syntax highlighting for PHP

I installed IntelliJ IDEA on Ubuntu 16.04 to use Symfony. There is syntax highlighting for .yml files, but there is no syntax highlighting for .php files. How to add syntax highlighting for .php files ...
Ramasamy Viswanathan's user avatar
0 votes
1 answer
92 views

gnome-terminal highlight URLs ending in close-paren

When gnome-terminal 3.6.2 highlights a URL ending in ), it incorrectly omits that ). Such URLs are found in wikis with disambiguation pages, such as http://zelda.gamepedia.com/Ocarina_of_Time_(Item), ...
Camille Goudeseune's user avatar