https://github.com/pbrisbin/vim-compiler-stack
A vim compiler that uses stack ghc
https://github.com/pbrisbin/vim-compiler-stack
Last synced: 11 months ago
JSON representation
A vim compiler that uses stack ghc
- Host: GitHub
- URL: https://github.com/pbrisbin/vim-compiler-stack
- Owner: pbrisbin
- License: mit
- Created: 2016-02-02T00:50:50.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-08-29T15:40:58.000Z (over 8 years ago)
- Last Synced: 2025-01-03T16:44:23.541Z (about 1 year ago)
- Language: Vim script
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
A vim compiler that uses [`stack ghc`][stack].
[stack]: http://docs.haskellstack.org/en/stable/README.html
## Installation
1. Add `pbrisbin/vim-compiler-stack` to your preferred plugin manager
Example:
```vim
Plug 'pbrisbin/vim-compiler-stack'
```
1. Set the `compiler`, probably in a `FileType` hook
```vim
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 `map`ping it to an explicit action instead:
```vim
map c :silent :make
```
The following will automatically open and close the QuickFix window when errors
are found or resolved, which is handy in general (e.g. `:grep`):
```vim
autocmd QuickFixCmdPost l* nested lwindow
autocmd QuickFixCmdPost [^l]* nested cwindow
```
---
[CHANGELOG](./CHANGELOG.md) | [LICENSE](./LICENSE)