Suggestion: Add nano-syntax-highlighting to the system /etc/nanorc not to /etc/skel/.nanorc or leave it up to the user

Installed /xfce/22.1.3/manjaro-xfce-22.1.3-minimal-230529-linux61.iso and there is a .nanorc in the /root home directory.

The only content is an include for /usr/share/nano-syntax-highlighting/*.nanorc. The root user should have the bare minimum configuration and the user can add later if desired, perhaps at the system level.

root should not get a .nanorc automatically. And, in this particular case the highlighting package currently has an unresolved bug.

In addition this overrides the users’ .config/nano/nanorc

2 Likes

I disagree. I think that is a nice addition where you don’t have to do extra work. It always bothers me when I use debian based servers, since there is no highlighting enabled by default… :joy:

I use nano 7.2 here and there is no issue with that line. :man_shrugging:

What? If you open nano with sudo then it uses /root/.nanorc and as user /home/user/.nanorc. There is nothing overwritten.

Priority goes like that:

  1. Ëś/.nanorc
  2. $XDG_CONFIG_HOME/nano/nanorc
  3. Ëś/.config/nano/nanorc

Depending on which one is there, it takes the first in the priority list. So even here, nothing is overwritten, it is just how nano handles it.

And here I thought I’m the only one who likes them purdy colours!

Still though … it really should be
icolor normal " brightnormal"
not
icolor brightnormal " brightnormal"

And … I generally agree that root should be left alone.

I’m building a new virtual machine on the latest XFCE minimal Official Image, and was focused on root, but .nanorc actually exists in /etc/skel/ (does not on my host). I’ll change the title to reflect this.

I use .config/nano/nanorc for all users.

From man .nanorc:

I thought the line

  • include /usr/share/nano-syntax-highlighting/*.nanorc

should replace

  • include “/usr/share/nano/*.nanorc”

in

  • /etc/nanorc

Or, leave it up to the user to customize.


Then I spotted the quoted text below in nano-syntax-highlighting.install. This would have been perfectly okay.

It is the creation of .nanorc in the home directory that causes problems.

==> IMPORTANT!!!
==> To prevent overwriting your existing configuration, nanorc
==> was installed to /usr/share/nano-syntax-highlighting/nanorc.sample
==>
==> To install you should add the languages you want to your nano configuration file, system-wide or user-specific
==> system-wide: $ echo “include /usr/share/nano-syntax-highlighting/.nanorc" >> /etc/nanorc
==> user-specific: $ echo "include /usr/share/nano-syntax-highlighting/
.nanorc” >> ~/.nanorc

The file /usr/share/nano-syntax-highlighting/nanorc.sample does exists.

And there it is, getting installed into /etc/skel/, in the PKGBUILD.

package() {
  cd nanorc
  find . -name '*.nanorc' | xargs install -Dm644 -t "$pkgdir/usr/share/$pkgname/"
  install -m644 "nanorc.sample" "$pkgdir/usr/share/$pkgname/nanorc.sample"
  install -dm755 $pkgdir/etc/skel
  echo "include /usr/share/nano-syntax-highlighting/*.nanorc" >> $pkgdir/etc/skel/.nanorc
}