You'll need either Vim with Python 3 support, or Neovim. If you're on Vim with Python 2, please use our old plugin.
This plugin simply uses our language server. Every feature is supported. Additionally, we provide the basics: snippets and syntax highlighting.
If you are using a plugin manager, add a line such as the following to your .vimrc
:
" If using NeoBundle
NeoBundle 'reasonml-editor/vim-reason-plus'
" Or, if using Vundle
Bundle 'reasonml-editor/vim-reason-plus'
" Or, if using Vim-Plug
Plug 'reasonml-editor/vim-reason-plus'
You also need to install Vim/NeoVim's Language Client. Do follow its "Quick Start" section. The Reason configuration for that section is the following:
let g:LanguageClient_serverCommands = {
\ 'reason': ['ocaml-language-server', '--stdio'],
\ 'ocaml': ['ocaml-language-server', '--stdio'],
\ }
If the Quick Start instructions didn't work, make sure you read the complete installation guide. It's probably a Python issue.
See its guide on calling the available features and assigning shortcuts to them, e.g. LanguageClient_textDocument_definition
.
Please follow LanguageClient-neovim's documentation on how to configure features. Here's an example configuration you'd put in .vimrc
:
nnoremap <silent> gd :call LanguageClient_textDocument_definition()<cr>
nnoremap <silent> gf :call LanguageClient_textDocument_formatting()<cr>
nnoremap <silent> <cr> :call LanguageClient_textDocument_hover()<cr>
Triggering gf
in normal mode would format the buffer.
Some files from vim-reason-plus are based on the Rust vim plugin and so we are including that license.