All Projects → eagletmt → Ghcmod Vim

eagletmt / Ghcmod Vim

Happy Haskell programming on Vim, powered by ghc-mod

Labels

Projects that are alternatives of or similar to Ghcmod Vim

Vim Misc
Miscellaneous auto-load Vim scripts
Stars: ✭ 334 (-23.22%)
Mutual labels:  viml
Spacegray.vim
A Vim color scheme loosely based on the Spacegray Xcode theme.
Stars: ✭ 366 (-15.86%)
Mutual labels:  viml
Vim Devicons
Adds file type icons to Vim plugins such as: NERDTree, vim-airline, CtrlP, unite, Denite, lightline, vim-startify and many more
Stars: ✭ 4,473 (+928.28%)
Mutual labels:  viml
Xterm Color Table.vim
All 256 xterm colors with their RGB equivalents, right in Vim!
Stars: ✭ 344 (-20.92%)
Mutual labels:  viml
Vim Tags
Ctags generator for Vim
Stars: ✭ 356 (-18.16%)
Mutual labels:  viml
Vim Sublime
A ready to use minimal Vim (Sublime Text -like) .vimrc configuration
Stars: ✭ 384 (-11.72%)
Mutual labels:  viml
Lavalamp
A text editor theme that visually differentiates languages.
Stars: ✭ 328 (-24.6%)
Mutual labels:  viml
Vim Golang
Github mirror of Go vimscripts, synced with main repository
Stars: ✭ 432 (-0.69%)
Mutual labels:  viml
Eddie Vim
Yet another vimrc
Stars: ✭ 365 (-16.09%)
Mutual labels:  viml
Dbext.vim
Provides database access to many dbms (Oracle, Sybase, Microsoft, MySQL, DBI,..)
Stars: ✭ 397 (-8.74%)
Mutual labels:  viml
Vim Two Firewatch
A blend between duotone light and firewatch for atom
Stars: ✭ 345 (-20.69%)
Mutual labels:  viml
Python Syntax
Python syntax highlighting script for Vim
Stars: ✭ 354 (-18.62%)
Mutual labels:  viml
Todo.txt Vim
Vim plugin for Todo.txt
Stars: ✭ 383 (-11.95%)
Mutual labels:  viml
Vimroom
Simulating a vaguely WriteRoom-like environment in Vim.
Stars: ✭ 338 (-22.3%)
Mutual labels:  viml
Vim Startify
🔗 The fancy start screen for Vim.
Stars: ✭ 4,479 (+929.66%)
Mutual labels:  viml
Vim2hs
vim2hs :: Vim -> Haskell
Stars: ✭ 332 (-23.68%)
Mutual labels:  viml
Vim Swift
Adds Swift support to vim. It covers syntax, intenting, and more.
Stars: ✭ 373 (-14.25%)
Mutual labels:  viml
Vim Ruby Debugger
Vim plugin for debugging Ruby applications (using ruby-debug-ide gem)
Stars: ✭ 434 (-0.23%)
Mutual labels:  viml
Dotvim
lean & mean vim distribution
Stars: ✭ 425 (-2.3%)
Mutual labels:  viml
Yankring.vim
Maintains a history of previous yanks, changes and deletes
Stars: ✭ 391 (-10.11%)
Mutual labels:  viml

ghcmod.vim

Build Status Gitter chat

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)
  • Insert split function cases (ghc-mod split)

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

Requirements

Vim

ghcmod.vim contains ftplugin. Please make sure that filetype plugin is enabled. To check it, type :filetype and you would see something like this: filetype detection:ON plugin:ON indent:ON. You can enable it by :filetype plugin on. I highly recommend adding filetype plugin indent on to your vimrc. See :help :filetype-overview for more details.

vimproc

https://github.com/Shougo/vimproc

ghc-mod >= 5.0.0

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']

Also, there's buffer-local version b:ghcmod_ghc_options.

autocmd BufRead,BufNewFile ~/.xmonad/* call s:add_xmonad_path()
function! s:add_xmonad_path()
  if !exists('b:ghcmod_ghc_options')
    let b:ghcmod_ghc_options = []
  endif
  call add(b:ghcmod_ghc_options, '-i' . expand('~/.xmonad/lib'))
endfunction

: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

If you'd like to open in another way the quickfix, set g:ghcmod_open_quickfix_function.

let g:ghcmod_open_quickfix_function = 'GhcModQuickFix'
function! GhcModQuickFix()
  " for unite.vim and unite-quickfix
  :Unite -no-empty quickfix

  " for ctrlp
  ":CtrlPQuickfix

  " for FuzzyFinder
  ":FufQuickfix
endfunction

: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.

GhcModSplitFunCase

Split the function case by examining a type's constructors.

f :: [a] -> a
f x = _body

When you type :GhcModSplitFunCase at the x position, ghcmod-vim will replace it with:

f :: [a] -> a
f [] = _body
f (x:xs) = _body

GhcModSigCodegen

Insert initial code from the given signature.

func :: [a] -> Maybe b -> (a -> b) -> (a,b)

ghcmod-vim will insert initial code using typed holes.

func x y z f = _func_body

Instance declarations are also supported.

newtype D = D (Int,String)

class C a where
    cInt :: a -> Int
    cString :: a -> String

instance C D where

ghcmod-vim will insert:

    cInt x = _cInt_body
    cString x = _cString_body

Customize

See wiki page Customize.

License

BSD3 License, the same license as ghc-mod.

Copyright (c) 2012-2013, eagletmt

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].