Code Monkey home page Code Monkey logo

ghcmod-vim's Introduction

ghcmod.vim

Happy Haskell programming on Vim, powered by ghc-mod

Features

  • Displaying the type of sub-expressions (ghc-mod type)
  • Displaying error/warning messages and their locations (ghc-mod check and ghc-mod lint)
  • Displaying the expansion of splices (ghc-mod expand)

Completions are supported by another plugin. See neco-ghc .

Requirements

vimproc

https://github.com/Shougo/vimproc

ghc-mod

cabal install ghc-mod

Details

If you'd like to give GHC options, set g:ghcmod_ghc_options.

let g:ghcmod_ghc_options = ['-idir1', '-idir2']

:GhcModType, :GhcModTypeClear

Type :GhcModType on a expression, then the sub-expression is highlighted and its type is echoed. If you type :GhcModType multiple times, the sub-expression changes.

  1. type1
  2. type2
  3. type3
  4. type4
  5. type5

Since ghc-mod 1.10.8, not only sub-expressions but name bindings and sub-patterns are supported.

  • type-bind
  • type-pat

Type :GhcModTypeClear to clear sub-expression's highlight.

Sub-expressions are highlighted as Search by default. You can customize it by setting g:ghcmod_type_highlight .

hi ghcmodType ctermbg=yellow
let g:ghcmod_type_highlight = 'ghcmodType'

:GhcModCheck, :GhcModLint

You can get compiler errors/warnings by :GhcModCheck and they are available in quickfix window.

check

Similarly, type :GhcModLint to get suggestions by ghc-mod lint.

If you'd like to pass options to hlint, set g:ghcmod_hlint_options.

let g:ghcmod_hlint_options = ['--ignore=Redundant $']

lint

:GhcModCheckAsync, :GhcModLintAsync, :GhcModCheckAndLintAsync

You can run check and/or lint asynchronously.

This would be useful when you'd like to run check and/or lint automatically (especially on BufWritePost). See Customize wiki page for more detail.

:GhcModExpand

You can see the expansion of splices by :GhcModExpand and they are available in quickfix window.

expand

This feature was introduced since ghc-mod 1.10.10.

Customize

See wiki page Customize.

License

BSD3 License, the same license as ghc-mod.

Copyright (c) 2012, eagletmt

ghcmod-vim's People

Contributors

eagletmt avatar yuttie avatar ujihisa avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.