Skip to content

Instantly share code, notes, and snippets.

@typedt
Forked from pera/.ghci
Last active August 5, 2017 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save typedt/cd674c55b44ebcb9d7a17875de2d9254 to your computer and use it in GitHub Desktop.
Save typedt/cd674c55b44ebcb9d7a17875de2d9254 to your computer and use it in GitHub Desktop.
GHCi dot file
-- You need to install IPPrint and HsColour with cabal to use this config.
-- If you find all the loading messages anoying you may want to set an alias:
-- alias ghci="ghci -v0"
-- Or if you are using stack ghci:
-- alias ghci="stack --silent ghci --ghci-options -v0"
-- use color Cyan, with imported modules in bold
:set prompt "\n\ESC[1;36m%s\n\ESC[0;36m\STXλ> \ESC[m\STX"
-- if ghci >= v7.8.1 for multiline support:
:set +m
:set prompt2 "\ESC[36m\STX|\ESC[m\STX"
import qualified IPPrint
import qualified Language.Haskell.HsColour as HsColour
import qualified Language.Haskell.HsColour.Colourise as HsColour
import qualified Language.Haskell.HsColour.Output as HsColour
let myColourPrefs = HsColour.defaultColourPrefs { HsColour.conid = [HsColour.Foreground HsColour.Yellow, HsColour.Bold], HsColour.conop = [HsColour.Foreground HsColour.Yellow], HsColour.string = [HsColour.Foreground HsColour.Green], HsColour.char = [HsColour.Foreground HsColour.Cyan], HsColour.number = [HsColour.Foreground HsColour.Red, HsColour.Bold], HsColour.layout = [HsColour.Foreground HsColour.White], HsColour.keyglyph = [HsColour.Foreground HsColour.White] }
let myPrint = putStrLn . HsColour.hscolour (HsColour.TTYg HsColour.XTerm256Compatible) myColourPrefs False False "" False . IPPrint.pshow
:set -interactive-print=myPrint
-- hide previously loaded modules in prompt
:m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment