Skip to content

gebner/ensime-vim

 
 

Repository files navigation

ensime-vim

Join the chat at https://gitter.im/ensime/ensime-vim Build Status Coverage Status

ENSIME for the Editor of the Beast (Vim)

demo

alt tag

howto

You need websocket-client python package:

$ sudo pip install websocket-client

You should also export your BROWSER variable, for example in your bashrc:

export BROWSER=firefox

All the following commands should be run from your scala directory.

First you need ensime sbt plugin:

$ echo 'addSbtPlugin("org.ensime" % "ensime-sbt" % "0.2.3")' \
    >> ~/.sbt/0.13/plugins/plugins.sbt

Then, generate .ensime file:

$ sbt gen-ensime

Then install vim plugin, with Vundle, by adding to your .vimrc:

Plugin 'ensime/ensime-vim'

Or if you're using neovim, with vim-plug by installing neovim python module:

$ pip install neovim

and by adding to your .nvimrc:

Plug 'ensime/ensime-vim'

Then by doing a :PlugInstall and a :UpdateRemotePlugins under neovim

Finally, launch vim with the file(s) you want to edit:

$ vim src/scaloid/example/HelloScaloid.scala

event handling

Under neovim, for all commands except autocomplete, events are only handled when you move your cursor (CursorMoved event). Under vim, we use CursorHold event.

using ensime-vim

User documentation is available, you can also load it inside vim via:

:help ensime-vim

developer howto

vim plugin is generated from neovim plugin. You should install neo2vim ruby gem:

$ gem install neo2vim

Then you should do your modifications to:

rplugin/python/ensime.py 

And export them to vim plugin format via:

$ neo2vim rplugin/python/ensime.py ftplugin/scala_ensime.vim

All merges should be done on dev branch before being merged onto master

integrating with your own plugin

It is possible to register callbacks and send events to ensime. Check this plugin example.

developer info

Needs some love. Please get in contact if you would like to help! There was some old work that is no longer compatible with the ENSIME server but it may serve as a good starting place:

Reference launch script is https://gist.github.com/fommil/4ff3ad5b134280de5e46 (only works on Linux but should be adaptable to OS X)

About

ENSIME for the Editor of the Beast (Vim)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 81.6%
  • Vim Script 8.2%
  • Ruby 6.3%
  • Shell 3.8%
  • Makefile 0.1%