search

Home  >  Q&A  >  body text

The javascript.vim that highlights javascript in vim has been put into syntax, but it doesn't work.

As shown in the picture, part of it is highlighted, and some DOM attributes are not highlighted. Is this the reason?

Do I need to set anything in .vimrc?

迷茫迷茫2773 days ago663

reply all(3)I'll reply

  • 阿神

    阿神2017-05-16 16:44:12

    .vimrc 加入以下3句:
    syntax enable " enable syntax hightlight and completion
    syntax on " syntax highlighing
    filetype on " try to detect file types

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-16 16:44:12

    js highlighting (including js embedded in html, including independent js files), only uses a plug-in. https://github.com/pangloss/vim-javas...

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-16 16:44:12

    VIM’s default js syntax highlighting is quite unsatisfactory. You can find a better one online. However, I don’t recommend using too many plugins. Just take a look. However, it is recommended that you highlight the highlights, various parentheses, and various symbols, because these are the real delimiters in the code.

    reply
    0
  • Cancelreply