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 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.
- Close vim and reopen
- Run
:PlugStatus
to check your install and list of bundles - Run
:Unite menu
or hit<space><space>
to open the top Unite menu - Profit
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 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 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 had the briliant idea of using Unite to define a list of Menus with available commands and mappings, which inspired the following:
- lint - Linter with neomake
- node - Node & npm menu
- task - Task helpers (Grunt & Gulp)
- tern - Tern commands (https://github.com/ternjs/tern_for_vim)
- test - Test helpers (Mocha & Ava)
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 withnode
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 <command> [options]
Wrapper on top ofnpm
. -
:Npmi packages...
alias for:Npm install <args> --save
, except that it opens an horizontal buffer with only two lines displayed.
A list of UltiSnips snippets can be found in the snippets directory.
-
Common snippets like
f)
,()()
to create IIFE,#!
to expand node shebang,ok
forObject.keys()
,e
,l
to expandconsole.
-
ES6 snippets from https://github.com/isRuslan/vim-es6/tree/master/UltiSnips
-
React snippets from https://github.com/bentayloruk/vim-react-es6-snippets
Run :UltiSnipsEdit
to edit them or add additional ones.
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
another. With a little more work, t.vim will ask the user for values to
quickly 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.
g:neojs_bundles
Path to vim-plug plugin directories (~/.vim/bundles
)g:neojs_unite_delimiter
Change the prefix value used in Unite Menusg:neojs_pluginfile
Path to the file listing plugins to install and load (~/.vim/bundles/neojs/docs/plugins.md
)