Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn OFF (or at least override) syntax highlighting in nano via ~/.nanorc?

I am struggling finding a clear answer on disabling or overriding the color settings for the nano editor.

By default color syntax highlighting is enabled on my system. Clicking ALT+Y disables this, which is exactly what I want my default to be.

Any ideas?

like image 426
seanomlor Avatar asked Nov 03 '12 01:11

seanomlor


People also ask

Where is Nanorc located?

The nanorc file contains the default settings for nano, a small and friendly editor. The file should be in Unix format, not in DOS or Mac format. During startup, nano will first read the system-wide settings, from /etc/nanorc (the exact path might be different), and then the user-specific settings, from ~/. nanorc.


1 Answers

To disable syntax highlighting write following lines into ~/.nanorc:

set quiet
syntax "disabled" "."

The first line prevent error reporting. The second line defines a new color syntax.

You can also define a single syntax containing your favorite color in your ~/.nanorc:

syntax "disabled" "."
color brightgreen,black "."

I hope this helps.

like image 149
Jürgen G. Avatar answered Oct 18 '22 14:10

Jürgen G.