推荐用于 JavaScript 编码的 Vim 插件? [英] Recommended Vim plugins for JavaScript coding?

查看:21
本文介绍了推荐用于 JavaScript 编码的 Vim 插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 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.

  1. 使用您最喜欢的包管理器(Ubuntu 的 apt-get、Mac 的 home brew 等):
  1. Install the following packages using your favorite package-manager (Ubuntu's apt-get, Mac's home brew, etc.):
  1. exuberant-ctags

  • 注意:安装后确保运行 ctags 实际运行 exuberant-ctags 而不是操作系统预装的 ctags.您可以通过执行 ctags --version 找到.2. node (Node.js)
    • NOTE: After installing make sure running ctags actually runs exuberant-ctags and not the OS's preinstalled ctags. You can find out by executing ctags --version. 2. node (Node.js)
      1. 从github克隆DoctorJS:git clone https://github.com/mozilla/doctorjs.git
      2. 进入DoctorJS 目录和make install(您还需要安装make 应用程序,但这是非常基本的).
      1. Clone DoctorJS from github: git clone https://github.com/mozilla/doctorjs.git
      2. Go inside DoctorJS dir and make install (You'll also need the make 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's bin/ dir to my $PATH instead. See DoctorJS's GitHub and issues pages for more info.
          1. 安装 TagBar Vim 插件(注意: 是 TagBar,而不是旧的臭名昭著的 TagList!).
          2. 利润.:)
          1. Install the TagBar Vim plugin (NOTE: It's TagBar, not the old infamous TagList!).
          2. 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 插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆