node-client icon indicating copy to clipboard operation
node-client copied to clipboard

update README

Open watsoncj opened this issue 6 years ago • 7 comments

Glad to see node plugin support landed in Neovim 0.2.2! 🎆

This project README still references installing node-host.

What are the new requirements for building a Neovim plugin in node? Is there a way to confirm that the engine is available?

watsoncj avatar Nov 14 '17 15:11 watsoncj

This is useful for verifying that the provider is available:

:call health#provider#check()

## Clipboard (optional)
  - OK: Clipboard tool found: pbcopy

## Python 2 provider (optional)
  - INFO: `g:python_host_prog` is not set.  Searching for python2 in the environment.
  - INFO: Executable: /usr/local/bin/python2
  - INFO: Python2 version: 2.7.14
  - INFO: python2-neovim version: 0.1.13 (outdated; from /usr/local/lib/python2.7/site-packages/neovim)
  - WARNING: Latest python2-neovim is NOT installed: 0.2.0

## Python 3 provider (optional)
  - INFO: Disabled. g:loaded_python3_provider=1

## Ruby provider (optional)
  - INFO: Ruby: ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin16]
  - WARNING: Missing "neovim" gem.
    - ADVICE:
      - Run in shell: gem install neovim
      - Is the gem bin directory in $PATH? Check `gem environment`.
      - If you are using rvm/rbenv/chruby, try "rehashing".

## Node provider (optional)
  - INFO: Node: v8.9.1
  - INFO: Host: /usr/local/bin/neovim-node-host
  - OK: Latest "neovim" npm is installed: 3.5.0

watsoncj avatar Nov 14 '17 16:11 watsoncj

I've gathered the following requirements for using the node provider:

  • npm install -g yarn (not sure why yarn is required by the health check, if it really is a requirement the check should say so)
  • npm install -g neovim
  • Sample code must be built with Typescript
  • :UpdateRemotePlugins must be run after adding a new node plugin, vim-plug does not do this but it can be done like so:
Plug 'sample-node-plugin', {'do':':UpdateRemotePlugins'}

watsoncj avatar Nov 14 '17 18:11 watsoncj

  • yarn should not be a requirement, I will get that fixed asap.
  • I will add a boilerplate for an example plugin so people can clone and get started quickly (also maybe change sample code to be node6+ compatible?)

billyvg avatar Nov 14 '17 19:11 billyvg

Example plugin would be nice, looking forward to.

kutsan avatar Nov 19 '17 10:11 kutsan

I've copied the boilerplate plugin code from the readme into a repo with all the necessary babel config etc here: https://github.com/simlrh/neovim-node-plugin-example

simlrh avatar Mar 09 '18 16:03 simlrh

I'm just leaving a note here, you may not have to use babel in future, see https://github.com/neovim/node-client/issues/43. I'm really not a fan of babel when it comes to just node.

kutsan avatar Mar 09 '18 17:03 kutsan

README could definitely use an update.

  • still describes API as "work in progress", which can't really be the case now that the client is used in many plugins. And it's scary for users, many will bounce when seeing this note.
  • there is no complete quickstart, unlike the old README which had an example that defines a command, function, etc.
  • the "Class style", "Prototype style", "Decorator style" sections in the README could be moved to the examples/ directory, to condense the README.

justinmk avatar Nov 09 '18 12:11 justinmk