Red Hat Enterprise Linux; Red Hat Virtualization; Red Hat Identity Management; Red Hat Directory Server; Red Hat Certificate System; Red Hat Satellite; Red Hat Subscription Management; Red Hat Update Infrastructure; Red Hat Insights; Red Hat Ansible Tower; Red Hat Ansible Engine. Configuring the nano text editor nano is a small, free and friendly editor which aims to replace Pico, the default editor included in the non-free Pine package. Rather than just copying Pico's look and feel, nano also implements some missing (or disabled by default) features in Pico, such as 'search and replace' and 'goto line number'.
I am running Debian and I would like to turn on syntax highlighting for
nano
. My system has predefined syntax definitions......and I have included all of these in my
~/.nanorc
file.However, I get no syntax highlighting when I open code files with typical file extensions (.c, .h, etc). What's odd is that when I opened the
.nanorc
file to check it, the syntax highlighting was activated.Am I doing something wrong?
Daniel StandageDaniel Standage
1 Answer
My guess is that something is wrong with your ~/.nanorc (syntax, line endings or something) since you get correct hilighting for ****.nanorc*** that is globally enabled by default in /etc/nanorc.
Try adding just a single include (e.g.
include '/usr/share/nano/c.nanorc'
) to /etc/nanorc and see what happens.Edit: well, it is rather strange, but the order of includes seems to have matter too... At a glance, everything works when ****.nanorc*** files are included in alphabetical order.
barti_ddubarti_ddu