Vim: Sudo Edit Breaks Apache Syntax Highlighting -
sudo edit (sudo -e) allows unprivileged users edit files securely. achieve this, makes temporary copy of file edit , copies on when editing done.
when i'm editing apache file (eg, /etc/apache2/sites-enabled/mysite.com), sudoedit vim can't figure out should use apache syntax highlighting, have manually :set syntax=apache. suspect vim's rule syntax highlighting relies on full path of file, , since sudoedit changes file /var/tmp/mysiterandomchars.com, loses path information.
is there way me automatically tell vim should use apache syntax highlighting?
thanks!
this sounds 1 of rare use-cases vi modeline feature:
in .vimrc
:
set modeline
and in apache config file, somewhere @ top or bottom:
# vi: syntax=apache
Comments
Post a Comment