You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I spent quite a bit of time making a formatter for ghci (the haskell repl) and I imagine a lot of people are just going to give up trying to make REPLSendVisual work. I think documenting it as an example in the add your own repl or faq section would be very helpful.
Here's what I made:
-- to send a multiline function declaration to ghci you need to-- surround it like so:-- :{-- code here-- more code-- :}-- this function formats your visual selection to send it to ghcifunctionsendLinesGhci(lines)
locali=1locale=#lineswhilei<=edowhilelines[i] =='' doi=i+1end-- If there's more than 1 non empty line leftifi<ethentable.insert(lines, i, ':{')
i=i+1e=e+1whilei<=eandlines[i] ~='' doi=i+1endtable.insert(lines, i, ':}')
i=i+1e=e+1else-- if there's only 1 left skip it to end the loopi=i+1endendtable.insert(lines, '\n')
returnlinesendlocalyarepl=require'yarepl'yarepl.setup {
wincmd='vertical topleft 80 split',
metas= {
ghci= { cmd='ghci', formatter=sendLinesGhci },
},
}
if you want I can make a pr updating the readme.
The text was updated successfully, but these errors were encountered:
I spent quite a bit of time making a formatter for ghci (the haskell repl) and I imagine a lot of people are just going to give up trying to make REPLSendVisual work. I think documenting it as an example in the
add your own repl
orfaq
section would be very helpful.Here's what I made:
if you want I can make a pr updating the readme.
The text was updated successfully, but these errors were encountered: