neojs


Ⅰ. 插件描述

(WIP) Lightweight bag of utilities for neovim JavaScript developers

Ⅱ. 基本信息

创建日期:  2016-04-14
使用用户:  2
Github星:  82
插件作者:  vimlab

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'vimlab/neojs'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'vimlab/neojs'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'vimlab/neojs'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/vimlab/neojs

Ⅳ. 文档说明

<h1 align="center">

<img width="360" src="./resources/neojs.png" alt="neojs">
<br>
<br>

</h1>


Lightweight bag of utilities for NeoVim JavaScript developers


  • A carefully crafted set of plugins for JavaScript development with [nvim][]
  • [Sensible][] defaults and Syntax files for ES5 / ES6
  • Awesome JS completion using [deoplete][] and [Tern][]
  • Super fast asynchronous linting with [neomake][]
  • Shortcut commands to interact with npm & node
  • Ability to hit Ctrl+R to launch current file with node
  • Wrappers to popular JavaScript task runners like [Grunt] or [Gulp]
  • Same goodies for popular JavaScript test runners such as [Mocha] or [Ava]
  • A good amount of [UltiSnips][] snippets for ES6 & React
  • A bunch of templates (init new buffers with arbitrary content)

Install

Install [vim-plug][] and put this line into your .vimrc

Plug 'vimlab/neojs'

On first launch, it will install the list of plugins defined in plugin/plugins.md.

  1. Close vim and reopen
  2. Run :PlugStatus to check your install and list of bundles
  3. Run :Unite menu or hit <space><space> to open the top Unite menu
  4. Profit

Plugins

The file plugin/plugins.vim uses vim-plug API to dynamically load the following plugins:

  • [vim-sensible][] A universal set of defaults that (hopefully) everyone can agree on.
  • [unite][] Unite is used to provide fuzzy finder like feature for various source
  • [neomake][] Neovim's Syntasic equivalent. Asynchronous linting using Neovim's job-control functionality
  • [deoplete][] Provides an asynchronous keyword completion system in the current buffer
  • [ternjs][] Tern based JavaScript editing support
  • [deoplete-ternjs][] deoplete source for javascript using Tern
  • [vim-javascript][] JavaScript bundle for vim, this bundle provides syntax and indent plugins
  • [yajs.vim][] Yet Another JavaScript Syntax file
  • [es.next.syntax.vim][] Syntax file is for ES7 and future syntax
  • [mdn.vim][] Query http://mdn.io and see the Markdown result in a vertical buffer
  • [jscs.vim][] jscs -x command: :Format can take range or operate on the whole file
  • [split-term.vim][] Utilites around neovim's :terminal
  • [vim-node][] Tools to make Vim superb for developing with Node
  • [node-host][] [Neovim's remote
    plugin](https://neovim.io/doc/user/remote_plugin.html) feature is kinda cool.

It is now possible to author neovim plugins using JavaScript and node only.
See this page for more informations on how to
create your own node plugin, or browse
mdown.vim code which is an experiment
on using neovim's and [node-host][] remote API.

When necessary, configuration for a given plugin can be found in
plugin/<plugin>.vim (ex. plugin/neomake.vim).

Unite Menus

[Unite][] is an awesome plugin for advanced VIM users. It offers a rich API to
compose and design UI, in a simple way.

[oh-my-vim] and [joedicastro's
dotfiles](https://github.com/joedicastro/dotfiles/tree/master/vim) had the
briliant idea of using Unite to define a list of Menus with available commands
and mappings, which inspired the following:

Ex.
Unite menus


Node

[vim-node][] already provides excellent support for node developement.

plugin/node.vim adds a few more goodies:

  • :NodeRun command to open a vertical :terminal buffer with node command.
    The current buffer is executed and the result displayed.
  • Ctrl+R is the default mapping to run :NodeRun
  • :Node <args> opens a 2-lines horizontal buffer with node prompt
  • :Require <args> helper to quickly add new require statements

npm

  • :Npm <command> [options] Wrapper on top of npm.
  • :Npmi packages... alias for :Npm install <args> --save, except that it opens
    an horizontal buffer with only two lines displayed.

Snippets

A list of [UltiSnips][] snippets can be found in the snippets
directory.

Run :UltiSnipsEdit to edit them or add additional ones.

Templates

[t.vim][] is a small "template" or scaffolding tool.

It takes a list of template files from ~/.vim/templates and use them to
initialize new buffer from predefined content.

Mustache like placeholders can be used to quickly jump from one item to

  1. With a little more work, [t.vim][] will ask the user for values to
  2. replace {{ var }}.

See templates/ directory to see the list of available
templates.

You can add more templates in ~/.vim/templates. The filename is important:
Use <language>.<ext> for a generic template to use for a particular filetype.
Any other name can be used for a more specific template. package.json is a
good example.

Configuration

  • g:neojs_bundles Path to vim-plug plugin directories (~/.vim/bundles)
  • g:neojs_unite_delimiter Change the prefix value used in Unite Menus
  • g:neojs_pluginfile Path to the file listing plugins to install and load
    (~/.vim/bundles/neojs/docs/plugins.md)

添加新评论