|
| 1 | +*ghcmod.txt* Happy Haskell programming on Vim, powered by ghc-mod |
| 2 | + |
| 3 | +Author: eagletmt < [email protected]> |
| 4 | +Repository: https://github.com/eagletmt/ghcmod-vim |
| 5 | + |
| 6 | +CONTENTS *ghcmod-contents* |
| 7 | + |
| 8 | +Features |ghcmod-features| |
| 9 | +Requirements |ghcmod-requirements| |
| 10 | +Details |ghcmod-details| |
| 11 | +Global variables |ghcmod-global-variables| |
| 12 | +Customize |ghcmod-customize| |
| 13 | +License |ghcmod-license| |
| 14 | + |
| 15 | +============================================================================== |
| 16 | +FEATURES *ghcmod-features* |
| 17 | + |
| 18 | +- Displaying the type of sub-expressions (ghc-mod type) |
| 19 | +- Displaying error/warning messages and their locations (ghc-mod check and |
| 20 | + ghc-mod lint) |
| 21 | +- Displaying the expansion of splices (ghc-mod expand) |
| 22 | + |
| 23 | +Completions are supported by another plugin. See neco-ghc |
| 24 | +<https://github.com/ujihisa/neco-ghc>. |
| 25 | + |
| 26 | +============================================================================== |
| 27 | +REQUIREMENTS *ghcmod-requirements* |
| 28 | + |
| 29 | +- vimproc <https://github.com/Shougo/vimproc> |
| 30 | +- ghc-mod <https://github.com/kazu-yamamoto/ghc-mod> |
| 31 | + |
| 32 | +You can install ghc-mod via cabal-install. |
| 33 | +> |
| 34 | + cabal install ghc-mod |
| 35 | +< |
| 36 | + |
| 37 | +============================================================================== |
| 38 | +DETAILS *ghcmod-details* |
| 39 | + |
| 40 | +If you'd like to give GHC options, set |g:ghcmod_ghc_options|. |
| 41 | + |
| 42 | +:GhcModType *:GhcModType* |
| 43 | + The sub-expression under the cursor is highlighted and its type is |
| 44 | + echoed. If you type |:GhcModType| multiple times, the sub-expression |
| 45 | + changes. |
| 46 | + |
| 47 | + Sub-expressions are highlighted as |hl-Search| by default. You can |
| 48 | + customize it by setting |g:ghcmod_type_highlight|. |
| 49 | + |
| 50 | +:GhcModTypeClear *:GhcModTypeClear* |
| 51 | + Clear the highlight created by |:GhcModType|. |
| 52 | + |
| 53 | +:GhcModCheck *:GhcModCheck* |
| 54 | + Display compiler errors/warnings in |quickfix|. |
| 55 | + |
| 56 | +:GhcModLint *:GhcModLint* |
| 57 | + Display hlint suggestions in |quickfix|. If you'd like to pass options |
| 58 | + to hlint, set |g:ghcmod_hlint_options|. |
| 59 | + |
| 60 | +:GhcModCheckAsync *:GhcModCheckAsync* |
| 61 | + Asynchronous variant of |:GhcModCheck|. This would be useful when |
| 62 | + you'd like to run check and/or lint automatically (especially on |
| 63 | + |BufWritePost|). See |ghcmod-customize| wiki page for more detail. |
| 64 | + |
| 65 | +:GhcModLintAsync *:GhcModLintAsync* |
| 66 | + Asynchronous variant of |:GhcModLint|. |
| 67 | + |
| 68 | +:GhcModCheckAndLintAsync *:GhcModCheckAndLintAsync* |
| 69 | + Perform |:GhcModCheck| and |:GhcModLint| asynchronously. |
| 70 | + |
| 71 | +:GhcModExpand *:GhcModExpand* |
| 72 | + Display the expansion of splices in |quickfix|. |
| 73 | + |
| 74 | +============================================================================== |
| 75 | +GLOBAL VARIABLES *ghcmod-global-variables* |
| 76 | + |
| 77 | +g:ghcmod_ghc_options *g:ghcmod_ghc_options* |
| 78 | + Pass these options to GHC. By default, ghcmod doesn't pass any GHC |
| 79 | + options. When ghcmod finds a Cabal directory structure, ghcmod |
| 80 | + automatically append suitable options for it. |
| 81 | + |
| 82 | + Example: passing -idir1 and -idir2 to GHC |
| 83 | +> |
| 84 | + let g:ghcmod_ghc_options = ['-idir1', '-idir2'] |
| 85 | +< |
| 86 | + |
| 87 | +g:ghcmod_hlint_options *g:ghcmod_hlint_options* |
| 88 | + Pass these options to hlint. By default, ghcmod doesn't pass any GHC |
| 89 | + options. |
| 90 | + |
| 91 | + Example: passing --ignore=Redundant $ to hlint |
| 92 | +> |
| 93 | + let g:ghcmod_hlint_options = ['--ignore=Redundant $'] |
| 94 | +< |
| 95 | + |
| 96 | +g:ghcmod_type_highlight *g:ghcmod_type_highlight* |
| 97 | + The highlight group used in |:GhcModType|. By default, Search group is |
| 98 | + used. See |:highlight| for details on highlighting. |
| 99 | + |
| 100 | + Example: highlighting sub-expressions with yellow background |
| 101 | +> |
| 102 | + let ghcmodType ctermbg=yellow |
| 103 | + let g:ghcmod_type_highlight = 'ghcmodType' |
| 104 | +< |
| 105 | + |
| 106 | +============================================================================== |
| 107 | +CUSTOMIZE *ghcmod-customize* |
| 108 | + |
| 109 | +See wiki page <https://github.com/eagletmt/ghcmod-vim/wiki/Customize>. |
| 110 | + |
| 111 | +============================================================================== |
| 112 | +LICENSE *ghcmod-license* |
| 113 | + |
| 114 | +BSD3 License, the same license as ghc-mod. |
| 115 | + |
| 116 | +vim:tw=78:ts=8:noet:ft=help:norl: |
0 commit comments