GithubHelp home page GithubHelp logo

yazgoo / ensime-vim Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 49.0 367 KB

ENSIME for the Editor of the Beast (Vim)

License: MIT License

Ruby 6.25% Python 81.63% Vim Script 8.22% Shell 3.77% Makefile 0.13%

ensime-vim's Introduction

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.1.7")' \
    >> ~/.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)

ensime-vim's People

Contributors

divarvel avatar fommil avatar gitter-badger avatar jd557 avatar kstep avatar ktonga avatar todesking avatar vito-c avatar xanderdunn avatar yazgoo avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.