scopatz / nanorc

Improved Nano Syntax Highlighting Files
Other
3k stars 549 forks source link

Syntax Highlighting does not appear when I sudo [Arch] #383

Open MacaroniGurl opened 2 years ago

MacaroniGurl commented 2 years ago

I installed the Syntax Highlighting through curl, and for some reason on Arch Linux it does not appear in sudo nano.

cvemys commented 2 years ago

when you run sudo,the program will run as the root user therefore it will search /root for config files instead of your user home directory.so if you need syntax highlighting while running nano as root you can either copy your .nanorc file to /root or use -f option and provide the path to nanorc file. quoting from nano man page:

-f file, --rcfile=file Read only this file for setting nano's options, instead of reading both the system-wide and the user's nanorc files.