A neovim plugin for Intero, forked from ghcmod-vim
VimL Haskell
Latest commit db40713 Jan 22, 2017 @parsonsmatt committed on GitHub Merge pull request #27 from isovector/master
Fix calls to `timer_start`
Permalink
Failed to load latest commit information.
after/ftplugin fix Aug 13, 2016
autoload fix `timer_start` interface Jan 22, 2017
example v1.0.0 Jul 23, 2016
plugin v1.0.0 Jul 23, 2016
.gitignore v1.0.0 Jul 23, 2016
CHANGELOG.md fix Aug 13, 2016
CONTRIBUTING.md Add contributing Jul 23, 2016
README.md Update readme, move code around Jul 23, 2016
demo-install-lo.gif v1.0.0 Jul 23, 2016
demo-repl-lo.gif v1.0.0 Jul 23, 2016

README.md

intero-neovim : v1.0.0

Get the lightning fast type information and go-to-definition that Intero provides without going to the dark side of emacs!

Installing

This plugin is compatible with pathogen, vim-plug, etc.

After you've installed the plugin, it'll keep your intero installs setup for you. I recommend adding intero-0.1.16 to your stack.yaml build-depends to ensure you get the newer version, as the intero-0.1.15 version doesn't automatically collect type information.

Demo of Installation

Usage

This plugin provides an integration with Intero via Neovim's terminal and asynchronous job control. You might like the following shortcuts:

" Process management:
nnoremap <Leader>hio :InteroOpen<CR>
nnoremap <Leader>hik :InteroKill<CR>
nnoremap <Leader>hic :InteroHide<CR>
nnoremap <Leader>hil :InteroLoadCurrentModule<CR>

" REPL commands
nnoremap <Leader>hie :InteroEval<CR>
nnoremap <Leader>hit :InteroGenericType<CR>
nnoremap <Leader>hiT :InteroType<CR>
nnoremap <Leader>hii :InteroInfo<CR>
nnoremap <Leader>hiI :InteroTypeInsert<CR>

" Go to definition:
nnoremap <Leader>hid :InteroGoToDef<CR>

" Highlight uses of identifier:
nnoremap <Leader>hiu :InteroUses<CR>

" Reload the file in Intero after saving
autocmd! BufWritePost *.hs InteroReload

REPL demo

The following commands are available:

InteroEval

This prompts the user to input a string, which gets sent to the REPL and evaluated by Intero.

InteroResponse

This retrieves the last thing that was evaluated by intero.

InteroGenericType

This gets the type at the current point.

InteroTypeInsert

Inserts the type of the current identifier in the above line at the top level.

InteroType

This gets the type at the current point without generalizing the term.

InteroUses

Highlights all uses of the current identifier and sets it to be the search term. Also runs the command :uses in the Intero REPL.

InteroGoToDef

Jumps to the definition of the current item if it is defined in the same package. Otherwise, echoes where it is defined.

InteroReload

Issues a :r to the REPL, causing it to reload the current module set.

InteroLoadCurrentModule

This loads the current module.

InteroOpen

Opens the Intero terminal buffer.

InteroHide

Hides the Intero buffer without killing the process.

InteroStart

This starts an Intero process connected to a terminal buffer. It's hidden at first.

InteroKill

Kills the Intero process and buffer.

Completion

Completion is not handled by this plugin. Check out neco-ghc for fast autocompletion using deoplete or omnicomplete. If you have good reason for wanting Intero-provided completion, please post in the related issue.

License

BSD3 License, the same license as ghcmod-vim.