Use GHCi sessions in a q:
-like command-line window that
when you insert <CR>
,
the current line will be sent to ghci and outputs will be notified
https://github.com/user-attachments/assets/53f53f8c-6e49-42fd-bd8b-9808614e15d8
Basically, run GHCi/cabal repl/stack ghci but you don't need to leave vim motions aside
This plugin contaminates your environment by
ghci
; once you setup
, API functions will be available:GHCi [args]
, quick way to spawn a session (can be turned off)-- Configure plugin behaviour here
-- can be setup multiple times - each time override previous config
-- check doc for configuration spec & defaults
local GHCi = require('ghci').setup {...}
-- Spawn a GHCi session.
-- Example: GHCi.spawn { cmd = { 'stack', 'ghci' } }
---@param extra? ghci.Config.Session Any extra session configuration
---@return vim.SystemObj
local job = GHCi.spawn()
-- Attach a spawned session to a window.
---@param job vim.SystemObj
---@param win? integer Current window by default
---@param extra? ghci.Config.Attach Extra attach configuration
GHCi.attach(job)
:GHCi [args]
spawns a GHCi session and attach it to current window
_print
or something) for custom interactive print, which pollutes GHCi environment
:reload
:load
etc. where the binding will not survive:set prompt
to something else - we need to know the end of outputWTFPL