Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.

pbrisbin/vim-compiler-stack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Note

All of my GitHub repositories have been archived and will be migrated to Codeberg as I next work on them. This repository either now lives, or will live, at:

https://codeberg.org/pbrisbin/vim-compiler-stack

If you need to report an Issue or raise a PR, and this migration hasn't happened yet, send an email to me@pbrisbin.com.

A vim compiler that uses stack ghc.

Installation

  1. Add pbrisbin/vim-compiler-stack to your preferred plugin manager

    Example:

    Plug 'pbrisbin/vim-compiler-stack'
  2. Set the compiler, probably in a FileType hook

    autocmd FileType haskell compiler ghc

    TODO: do this automatically in an after plugin.

Usage

Run :make in a Haskell file. Move through errors with :cn/:cp, view them in a list with :copen.

GHC Configuration

The compilation process will respect {.,~}/ghci, so any required settings should be added there (e.g. language extensions). This makes it trivial to have global and project-local settings.

Extra Configuration

I don't recommend triggering compilation on every write. This plugin doesn't aim to do anything fancy to avoid the UI freeze while ghc is doing its thing. Therefore, I recommend mapping it to an explicit action instead:

map <Leader>c :silent :make<CR>

The following will automatically open and close the QuickFix window when errors are found or resolved, which is handy in general (e.g. :grep):

autocmd QuickFixCmdPost    l* nested lwindow
autocmd QuickFixCmdPost [^l]* nested cwindow

CHANGELOG | LICENSE

About

A vim compiler that uses stack ghc

Resources

License

Stars

Watchers

Forks

Packages

No packages published