1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 13:00:04 +08:00

Add REPL support for haskell

This commit is contained in:
Shidong Wang 2020-01-20 01:46:58 +08:00
parent 129271243c
commit 57bbd12053

View File

@ -50,6 +50,7 @@ endfunction
function! SpaceVim#layers#lang#haskell#config() abort
let g:haskellmode_completion_ghc = 0
call SpaceVim#plugins#repl#reg('haskell', 'ghci')
call SpaceVim#plugins#runner#reg_runner('haskell', [
\ 'ghc -v0 --make %s -o #TEMP#',
\ '#TEMP#'])
@ -82,4 +83,17 @@ function! s:on_ft() abort
call SpaceVim#mapping#space#langSPC('nmap', ['l', 'r'],
\ 'call SpaceVim#plugins#runner#open()', 'execute current file', 1)
let g:_spacevim_mappings_space.l.s = {'name' : '+Send'}
call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 'i'],
\ 'call SpaceVim#plugins#repl#start("haskell")',
\ 'start REPL process', 1)
call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 'l'],
\ 'call SpaceVim#plugins#repl#send("line")',
\ 'send line and keep code buffer focused', 1)
call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 'b'],
\ 'call SpaceVim#plugins#repl#send("buffer")',
\ 'send buffer and keep code buffer focused', 1)
call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 's'],
\ 'call SpaceVim#plugins#repl#send("selection")',
\ 'send selection and keep code buffer focused', 1)
endfunction