Ⅰ. 插件描述
VIM JavaScript syntax highlighterⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'marcelbeumer/javascript-syntax-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'marcelbeumer/javascript-syntax-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'marcelbeumer/javascript-syntax-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/marcelbeumer/javascript-syntax.vim
Ⅳ. 文档说明
#Javascript Syntax for Vim
JavaScript syntax highlighter that does what I want it to do for modern JS development.
I aim to map language features to the proper VIM highlighting identifiers, and make sure it plays nice with my favorite color themes Molokai and Spacedust.
The highlighter was initially forked from this syntax highlighter and still contains 90% of the regexes. I tried to make the syntax file more readable, removed unwanted DOM/HTML/CSS things, fixed identifier mappings and added a few things such as:
- function name coloring (jsFuncName controlled by hi Function)
- class names (controlled by hi Structure)
- this/that acesss (jsContext and jsContextAccess controlled by hi Special)
- Browser, development and module keywords
Customization
Tastes and opinions differ. I invite you to fork this repository and make changes in the highlighter or play with options commenting stuff in and out. In case you do, I recommend using the vim-reload plugin to automatically reload your plugins when editing them.
Screenshot

Install
Either:
- Copy ftdetect and syntax directories into ~/.vim
- Or use pathogen.vim
- Or use the awesome vundle plugin manager (recommended)