I have a file called zshrc
(not .zshrc
). Emacs does not recognize that it must use sh-mode
automatically. I want to put some sort of hint for emacs to pick up and syntax highlight my file accordingly.
how do I achieve that?
I have a file called zshrc
(not .zshrc
). Emacs does not recognize that it must use sh-mode
automatically. I want to put some sort of hint for emacs to pick up and syntax highlight my file accordingly.
how do I achieve that?
You can use a file-local variable to specify the mode.
You can either put them at the top of the file, like so:
# -*- mode: sh -*-
or at the bottom of the file, like so:
# Local Variables:
# mode: sh
# End:
// -*- mode: php -*-
in a PHP file with a non-standard extension but it doesn't seem to work. Have I got the syntax wrong? //
is a valid PHP comment prefix
– vfclists
Jun 26 '17 at 5:15
auto-mode-alist
to set"zshrc\\'"
tosh-mode
. – Kaushal Modi Aug 24 '16 at 3:17