You will need a version of Vim built with Python plugin support. This is standard on most distribution packages these days. Try vim --version | grep +python to confirm.

If you’re using Ubuntu, as of 16.04, default Vim doesn’t have Python configured. See here for options to get Vim with Python. Note you need Python 2 support. Make sure pip installs below are for Python 2 as well (you might need to use pip2).

  1. Install external Python modules that ensime-vim requires to function:

     $ pip install websocket-client sexpdata
  2. If you use Neovim, additionally ensure you’ve installed the neovim module:

    $ pip install neovim
  3. If you’re using Neovim with Nix you will need to override the default derivation to include websocket-client and sexpdata since Nix-installed Neovim will not look in standard locations for Python packages. One of your options for doing this is through packageOverrides.

      packageOverrides = pkgs: rec {
        neovim = with pkgs; neovim.override { extraPythonPackages = with pythonPackages; [ websocket_client sexpdata ]; };

    Once it’s overridden make sure to re-install Neovim.

  4. Install the ENSIME plugin for your build tool
  5. Add ensime-vim to your plugin manager of choice in your .vimrc (or init.vim for Neovim):

    Plugin Manager Your .{n}vimrc
    Vim-Plug Plug 'ensime/ensime-vim'
      Plug 'ensime/ensime-vim', { 'do': ':UpdateRemotePlugins' } # if Neovim
    Vundle Plugin 'ensime/ensime-vim'

    Under the hood this is just another Vim plugin, so other plugin managers should work great as well.

  6. Install the vim-scala plugin for Scala filetype detection and highlighting. Optionally, install Syntastic as well for syntax checking integrated with ENSIME. Instructions for both plugins can be found in their respective documentation.
  7. Trigger the plugin installations after updating your configuration. With vim-plug this is done by executing :PlugInstall. With Vundle run :PluginInstall.
Post-Install Config

Depending on your preferences, you may want to add some of the following to your .vimrc