DEPRECATED: use idris2-nvim instead

November 17, 2021 ยท View on GitHub

WARNING: Plugin is still in experimental phase and requires nightly releases.

Requirements

  • Neovim 0.5 (currently nightly)
  • Idris2-Lua
  • Add luarocks packages to the path by running eval $(luarocks path --lua-version=5.1) or adding it to your shell configuration script (.bashrc, .zshrc,...) to persist it across sessions.
  • (Optional) For the go-to-definition command, the fd and fzf utilities are required. Also you have to create a new folder inside your .idris2 directory: idris2-0.3.0-src and copy source code from prelude, base, contrib, network, idris2, etc., i.e. any package you use, into that folder. The plugin will then be able to access the source and open the source files on the fly.

Install

You can install it with any plugin manager with the repository url. Example for vim-plug:

Plug 'ShinKage/nvim-idris2'

The plugin is pulled pre-compiled, if you want to compile it manually you can just execute a make build in the compiler directory.

Configuration

Keybindings can be customized by setting global options:

OptionDescriptionDefault binding
idris2_loadCurrent_keyReload the current file<LocalLeader>r
idris2_typeOf_keyType of the name under cursor<LocalLeader>t
idris2_typeOfPrompt_keyType of the name entered from a prompt window<LocalLeader>T
idris2_jumpTo_keyJump-to-definition by the name under the cursor<LocalLeader>j
idris2_jumpToPrompt_keyJump-to-definition by the name entered from a prompt window<LocalLeader>J
idris2_docOverviewDocumentation overview of the name under cursor<LocalLeader>d
idris2_caseSplit_keyTry case-split on argument under cursor<LocalLeader>c
idris2_exprSearch_keyTry expression search on hole under cursor<LocalLeader>s
idris2_exprSearchNext_keyTry next candidate expression search<LocalLeader>sn
idris2_addClause_keyAdds a clause for the definition under cursor<LocalLeader>a
idris2_generateDef_keyAdds a clause and search the definition under cursor<LocalLeader>g
idris2_generateDefNext_keyTry next candidate definition search<LocalLeader>gn
idris2_makeLemma_keyMake lemma function for hole under cursor<LocalLeader>l
idris2_makeCase_keyMake case boilerplate for hole under cursor<LocalLeader>mc
idris2_makeWith_keyMake with boilerplate for hole under cursor<LocalLeader>w
idris2_interpret_keyEvaluate the selected expression<LocalLeader>e

If you want to use an external IDE server instead of the one started by the plugin you can set g:idris2_external_server to true. The host and port for external server can be configured with g:idris2_external_host and g:idris2_external_port respectively. For the automatic server the port can be configured with g:idris2_server_port.

Automatic loading of opened Idris2 files can be disabled with setting to false the option g:idris2_load_on_start.