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:
- Installvim-plugif you haven't already.
- Add the following to your .vimrc:
Plug 'unisonweb/unison', { 'branch': 'trunk', 'rtp': 'editor-support/vim' }
- Issue the vim command
:PlugInstall
.
For more information run:help unison
from within vim or view theonline help doc.
NeoVim
Usinglazy.nvim:
- Installlazy.nvimif you haven't already.
- 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,
}
})
- Issue the vim command
:Lazy
.
Optionally you cansetup an LSP Server.
Atom
From the console, run:
apm install unisonweb/atom-unison
VS Code
- Install theUnison extension for VS Code
Emacs
There are currently two different ways to use Unison in Emacs. Both work with Unison’sLSP integration.
Unison Tree-sitter mode
This package is generally better all around, but isn’t inMELPAyet, and thus requires more setup.
If you don’t have Emacs 29 or newer, this also requiresinstallingtree-sitter
.
unisonlang-mode
This package is unsupported, incomplete, and out of date, but itisinMELPA,so you can enable it how you would any other Emacs package, and you’re done.