I noticed that when I open a file like ~/.bashrc
in Vim as root, the syntax highlighting (SH) when editing a bash script as normal user (blue for comments, orange for keywords, red for numbers, etc.) is not applied. Can anyone tell me which configuration this depends on? I'm using Debian Stretch.
Edit: I found out there is an option syntax on
in /etc/vim/vimrc
you can un-comment to enable syntax highlighting by default. I wonder why my normal user had this feature turned on by default whereas the super user had not.
sudo -e <file>
instead ofsudo vim <file>
. It's safer (seeman sudo
). – Ben Oct 25 '18 at 19:36