Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Windows 10 Haskell Devbox Setup




pacman --needed -Sy bash pacman pacman-mirrors msys2-runtime

Quit MSYS2 and relaunch it.

pacman -Su
pacman -S git

I turn off Git's conversion to CRLF, as we can work with LF just fine in MSYS2 & Sublime Text

git config --global core.autocrlf false

Install some helpful packages:

# Basic toolchain
pacman --needed -S base-devel mingw-w64-x86_64-toolchain mingw-w64-i686-toolchain
# 7zip
pacman -S p7zip
pacman -S mingw64/mingw-w64-x86_64-SDL2 mingw-w64-x86_64-pkg-config
# Freetype
pacman -S mingw64/mingw-w64-x86_64-freetype mingw64/mingw-w64-x86_64-glew

# FYI, to list all packages:
pacman -Ss | grep name


Download cmder-mini from

Run Windows Powershell as Administator and run:

Set-ExecutionPolicy RemoteSigned

Create cmder_mingw64.bat in c:\msys64:

@echo off
cd /d c:\msys64

call .\usr\bin\sh --login -i

In cmder settings>Tasks (under Startup) add a task named msys2 with the command:

-new_console:d:C:\msys64\home\YOUR_USERNAME "c:\msys64\cmder_mingw64.bat"
  • Under Startup: Check "Specify named task", {MSYS2}

  • Under Startup>Tasks: Check "Default task for new console"

  • Under Keys & Macro: add a hotkey for Ctrl-T to open {MSYS2}

To use ssh-agent, copy and paste from to ~/.profile

For git prompt niceties, download the git prompt script

curl -o ~/

and add to ~/.profile:

BLACK="$(tput setaf 0 2>/dev/null || echo '\e[0;30m')"
RED="$(tput setaf 1 2>/dev/null || echo '\e[0;31m')"
GREEN="$(tput setaf 2 2>/dev/null || echo '\e[0;32m')" 
YELLOW="$(tput setaf 3 2>/dev/null || echo '\e[0;33m')"
BLUE="$(tput setaf 4 2>/dev/null || echo '\e[0;34m')"
PURPLE="$(tput setaf 5 2>/dev/null || echo '\e[0;35m')"
CYAN="$(tput setaf 6 2>/dev/null || echo '\e[0;36m')"
WHITE="$(tput setaf 7 2>/dev/null || echo '\e[0;37m')"

# Set up git prompt
source ~/
PS1="\[$BLUE\]\u\[$YELLOW\]\[$YELLOW\]\w\[\033[m\]\[$PURPLE\]\$(__git_ps1)\[$WHITE\]\$ "

To allow Ctrl-LeftArrow and Ctrl-RightArrow navigation-by-word, add to ~/.inputrc

"\e[1;5C": forward-word   # ctrl + right
"\e[1;5D": backward-word  # ctrl + left

To allow selection with Shift-LeftArrow and Shift-RightArrow: Settings>Keys & Macro>Mark/Copy>Start selection with Shift+Arrow

To allow clicking to set the cursor: Settings>Keys & Macro>Mouse>Change prompt text cursor position with Left Click

Sublime Text

In Preferences > Settings - User, add:

"default_line_ending": "unix",
"hot_exit": false,

these keep Sublime from trying to reopen old windows (buggy on Windows), and switches to LF endings

*Use View->Line Endings to convert files from CRLF to LF

(We don't want to use CRLF ever, as it complicates git, breaks Pd, and Sublime handles LF just fine in Windows)

Disable changing text size with control-scrollwheel


Download GHC 8.0.2 (built by me, resolves a linker bug)

tar xvf and copy to /usr/local/ghc

Add GHC and Sublime Text to Windows' PATH by right-clicking the Start menu and editing System > Advanced > Environment Variables > Path:

C:\msys64\usr\local\ghc\bin;%APPDATA%\local\bin;C:\Program Files\Sublime Text 3;


Make sure to use 64bit stack so we get 64bit GHC too

Make sure stack uses the system GHC, and fix garbled stack output in Cmder: In %APPDATA%/stack/config.yaml

system-ghc: true
modify-code-page: false
skip-msys: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.