简体   繁体   中英

emacs better syntax highlighting for js

I'm a long time vim user looking to make the switch to emacs ... my vim kung fu is quite good but I suspect with emacs I can code even faster.

So far the Javascript syntax highlighting is inferior though. I've looked at https://github.com/mooz/js2-mode which says to install version 27, then install the package ... but that did nothing.

I'll post the different versions below. Am I missing something ?

Vim: vim着色

Emacs: emacs 着色

Thanks !!

To get the same font-locking for the object properties as the function calls, as shown in your vim example, you can Mx customize-face js2-object-property to inherit from font-lock-variable-name-face , or add an entry to custom-set-faces in your init

(custom-set-faces
 ;; ...
 '(js2-object-property ((t (:inherit font-lock-variable-name-face)))))

As you aren't getting any highlighting for function calls currently, it looks like you probably need to Mx package-reinstall js2-mode first.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM