Set up your editor for Unison

This document is a collection of user-submitted instructions for setting up a text editor for Unison development.

LSP Integration

As of UCM version M4a, the UCM supports the Language Server Protocol. Features like in-editor error reporting, show-type-on-hover, and autocompletion are implemented, with more to come! Instructions for installing the UCM with LSP supportare available here

Vim

Usingvim-plug:

  1. Installvim-plugif you haven't already.
  2. Add the following to your .vimrc:
Plug 'unisonweb/unison', { 'branch': 'trunk', 'rtp': 'editor-support/vim' }
  1. Issue the vim command:PlugInstall.

For more information run:help unisonfrom within vim or view theonline help doc.

NeoVim

Usinglazy.nvim:

  1. Installlazy.nvimif you haven't already.
  2. Add the following to your init.lua:
require("lazy").setup({
  {
    -- Unison
    "unisonweb/unison",
    branch = "trunk",
    config = function(plugin)
        vim.opt.rtp:append(plugin.dir .. "/editor-support/vim")
        require("lazy.core.loader").packadd(plugin.dir .. "/editor-support/vim")
    end,
    init = function(plugin)
         require("lazy.core.loader").ftdetect(plugin.dir .. "/editor-support/vim")
    end,
  }
})
  1. Issue the vim command:Lazy.

Optionally you cansetup an LSP Server.

Atom

From the console, run:

apm install unisonweb/atom-unison

VS Code

  1. Install theUnison extension for VS Code

Emacs

Installunison-mode.