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

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


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

set quietsyntax "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.


For future references, I would add that you can run nano without colors using the command line parameter -Y

nano -Ynone myfile.txt

The "none" syntax is reserved; specifying it on the command line is the same as not having a syntax at all.

You can set an alias in your .bash_profile file:

alias nano='nano -Ynone'


This worked for me better than above since I run a white background terminal. It just makes all the text black again.

set quietsyntax "disabled" "."color black "."