Font-lock and disable js2-mode parsing node shebang line
问题 How can I treat the a shebang line of the form #! /usr/bin/env node As a comment line, when using js2-mode ? I've tried a couple things, one as a modification of something Stefan proposed on another thread (can't find it now), eg. a modification to the syntax-propertize-rules , (defalias 'my-js2-syntax-propertize-shebang (syntax-propertize-rules ("\\`\\(#\\)!.*/[^ \t\n]+" (1 "!")))) (defun my-js2-hook () (add-function :before (local 'syntax-propertize-rules) #'my-js2-syntax-propertize-shebang