<commit_before>
# ensime-vim

[![Join the chat at https://gitter.im/ensime/ensime-vim](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ensime/ensime-vim?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://drone.io/github.com/yazgoo/ensime-vim/status.png)](https://drone.io/github.com/yazgoo/ensime-vim/latest)

ENSIME for the Editor of the Beast (Vim)

# demo

![alt tag](https://raw.github.com/yazgoo/ensime-vim/master/doc/demo.gif)

# howto

You need `websocket-client` python package:

    $ sudo pip install websocket-client

You also need `ensime_launcher` package:

    $ sudo pip install ensime_launcher

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](https://github.com/VundleVim/Vundle.vim),
by adding to your .vimrc:

    Plugin 'ensime/ensime-vim'

Or if you're using neovim, with [vim-plug](https://github.com/junegunn/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](http://vim.wikia.com/wiki/Timer_to_execute_commands_periodically) event.

# using ensime-vim

[User documentation](doc/ensime-vim) 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<commit_msg>rfixes #43<commit_after>
# ensime-vim

[![Join the chat at https://gitter.im/ensime/ensime-vim](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ensime/ensime-vim?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://drone.io/github.com/yazgoo/ensime-vim/status.png)](https://drone.io/github.com/yazgoo/ensime-vim/latest)

ENSIME for the Editor of the Beast (Vim)

# demo

![alt tag](https://raw.github.com/yazgoo/ensime-vim/master/doc/demo.gif)

# howto

You need `websocket-client` python package:

    $ sudo pip install websocket-client

You also need `ensime_launcher` package:

    $ sudo pip install ensime_launcher

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](https://github.com/VundleVim/Vundle.vim),
by adding to your .vimrc:

    Plugin 'ensime/ensime-vim'

Or if you're using neovim, with [vim-plug](https://github.com/junegunn/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](http://vim.wikia.com/wiki/Timer_to_execute_commands_periodically) event.

# using ensime-vim

[User documentation](doc/ensime-vim.txt) 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
{'fraction_non_alphanumeric': 0.11023244668104482, 'fraction_numerical': 0.005271986580397795, 'mean_word_length': 4.0593939393939396, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 16, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '695313', 'n_tokens_mistral': 1540, 'n_tokens_neox': 1424, 'n_words': 398}