parsonsmatt / intero-neovim

A neovim plugin for Intero, forked from ghcmod-vim
218 stars 28 forks source link

Add :InteroSend command #98

Closed jez closed 7 years ago

jez commented 7 years ago

Adds the :InteroSend command.

This is handy for doing things like this:

" hoogle bindings
" (prereq: stack install hoogle && hoogle generate)

" Query hoogle for what's under the cursor, and put it in the intero buffer
au FileType haskell noremap <silent> <leader>iq :InteroSend<SPACE>:!hoogle<SPACE><C-R><C-W><CR>
" qUery hoogle for a User prompted string
au FileType haskell noremap <leader>iu :InteroSend<SPACE>:!hoogle<SPACE>

We could also do this with :InteroEval, but it's annoying because for multi-line output Vim prompts you to press Enter to continue. Instead, I just want my hoogle output (for example) to show up Inimmediately in the tero buffer.

rdnetto commented 7 years ago

lgtm, thanks for the PR. :)