问题描述
我是 JS & 新手维姆.哪些插件可以帮助我编写 Javascript 代码?
I'm new to JS & Vim. Which plugins would help me to write Javascript code?
推荐答案
语法检查/Linting
有一种非常简单的方法来集成 JSLint 或社区驱动的 jshint.com(这是更好的IMO) 与 Vim 一起使用 Syntastic Vim 插件.有关详细信息,请参阅我的其他帖子.
Syntax Checking / Linting
There is a very easy way to integrate JSLint or the community-driven jshint.com (which is much better IMO) with Vim using the Syntastic Vim plugin. See my other post for more info.
还有一种使用 Mozilla 的 DoctorJS(以前的 jsctags)添加标签列表的非常巧妙的方法,它也用于 Cloud9 IDE 的 王牌在线编辑器.
There's also a very neat way to add tag-listing using Mozilla's DoctorJS (formerly jsctags), which is also used in Cloud9 IDE's Ace online editor.
- 使用您最喜欢的包管理器(Ubuntu 的
apt-get
、Mac 的 homebrew
等):
- Install the following packages using your favorite package-manager (Ubuntu's
apt-get
, Mac's homebrew
, etc.):
exuberant-ctags
- 注意:安装后确保运行
ctags
实际运行exuberant-ctags
而不是操作系统预装的ctags
.您可以通过执行ctags --version
找到.2.node
(Node.js) - NOTE: After installing make sure running
ctags
actually runsexuberant-ctags
and not the OS's preinstalledctags
. You can find out by executingctags --version
.2.node
(Node.js) - 从github克隆
DoctorJS
:git clone https://github.com/mozilla/doctorjs.git
- 进入
DoctorJS
目录和make install
(您还需要安装make
应用程序,但这是非常基本的). - Clone
DoctorJS
from github:git clone https://github.com/mozilla/doctorjs.git
- Go inside
DoctorJS
dir andmake install
(You'll also need themake
app installed, but this is very basic). - 安装插件时存在一些错误,
make install
暂时无法解决问题.现在我只是将 repo 的bin/
目录添加到我的 $PATH 中.有关详细信息,请参阅 DoctorJS 的 GitHub 和问题页面. - There're some bugs with installing the plugin,
make install
doesn't do the trick for the moment. For now I just add the repo'sbin/
dir to my $PATH instead. See DoctorJS's GitHub and issues pages for more info. - 安装 TagBar Vim 插件(注意: 是 TagBar,而不是旧的臭名昭著的 TagList!).
- 利润.:)
- Install the TagBar Vim plugin (NOTE: It's TagBar, not the old infamous TagList!).
- PROFIT. :)
新项目 - Tern.js
DoctorJS 目前已死.有一个名为 tern.js 的新项目.它目前处于早期测试阶段,最终应该会取代它.
New Project - Tern.js
DoctorJS is currently dead. There's a new promising project called tern.js. It's currently in early beta, and should eventually replace it.
有一个项目 ramitos/jsctags 使用 tern 作为其引擎.只需 npm install -g
它,标签栏就会自动将它用于 javascript 文件.
There is a project ramitos/jsctags which uses tern as its engine. Just npm install -g
it, and tagbar will automatically use it for javascript files.
这篇关于推荐用于 JavaScript 编码的 Vim 插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!