Difference between revisions of "Vim"

From HaskellWiki
Jump to navigation Jump to search
(→‎Vim as a Haskell IDE: link HLS docs)
(rename plugins section, reduce heading level)
Line 1: Line 1:
 
[[Category:Development tools]]
 
[[Category:Development tools]]
 
= Vim as a Haskell IDE =
 
   
 
There is a wide range of tools and corresponding VIM plugins that provide IDE-like features for Haskell development: [[haskell-language-server]] (implements the Language Server Protocol, thus needs a VIM LSP client), Intero, Dante, Codex, hdevtools and more. A less feature-rich but stable solution is to have ghcid running next to the editor window as described in [https://www.parsonsmatt.org/2018/05/19/ghcid_for_the_win.html]
 
There is a wide range of tools and corresponding VIM plugins that provide IDE-like features for Haskell development: [[haskell-language-server]] (implements the Language Server Protocol, thus needs a VIM LSP client), Intero, Dante, Codex, hdevtools and more. A less feature-rich but stable solution is to have ghcid running next to the editor window as described in [https://www.parsonsmatt.org/2018/05/19/ghcid_for_the_win.html]
Line 8: Line 6:
 
If you want to use the [[Haskell Language Server]] with Vim or Neovim, there is a section in the docs for that: [https://github.com/haskell/haskell-language-server#using-haskell-language-server-with-vim-or-neovim Using haskell-language-server with Vim or NeoVim].
 
If you want to use the [[Haskell Language Server]] with Vim or Neovim, there is a section in the docs for that: [https://github.com/haskell/haskell-language-server#using-haskell-language-server-with-vim-or-neovim Using haskell-language-server with Vim or NeoVim].
   
  +
== Assorted plugins for Vim or NeoVim ==
= Plugins =
 
   
 
* [https://github.com/neoclide/coc.nvim coc.nvim] Intellisense engine for Vim8 & Neovim, full language server protocol support as VSCode. Follow haskell-ide-engine [https://github.com/haskell/haskell-ide-engine#coc instructions] to add support for completion, linting, formatting, go to definition, etc.
 
* [https://github.com/neoclide/coc.nvim coc.nvim] Intellisense engine for Vim8 & Neovim, full language server protocol support as VSCode. Follow haskell-ide-engine [https://github.com/haskell/haskell-ide-engine#coc instructions] to add support for completion, linting, formatting, go to definition, etc.

Revision as of 20:35, 9 December 2020


There is a wide range of tools and corresponding VIM plugins that provide IDE-like features for Haskell development: haskell-language-server (implements the Language Server Protocol, thus needs a VIM LSP client), Intero, Dante, Codex, hdevtools and more. A less feature-rich but stable solution is to have ghcid running next to the editor window as described in [1]

Haskell Language Server

If you want to use the Haskell Language Server with Vim or Neovim, there is a section in the docs for that: Using haskell-language-server with Vim or NeoVim.

Assorted plugins for Vim or NeoVim

  • coc.nvim Intellisense engine for Vim8 & Neovim, full language server protocol support as VSCode. Follow haskell-ide-engine instructions to add support for completion, linting, formatting, go to definition, etc.
  • haskell-vim Quote from [2]: "It’s the filetype plugin for Haskell that should ship with Vim."
  • Ale (Asynchronous Linting Engine)

ALE (Asynchronous Lint Engine) is a plugin for providing linting (checking syntax and semantics) in NeoVim 0.2.0+ and Vim 8 while you edit your text files, and acts as a Vim Language Server Protocol client.

Comes with linters cabal_ghc, ghc, ghc_mod, hdevtools, hie, hlint, stack_build, stack_ghc

hdevtools is a command line program powered by the GHC API, that provides services for Haskell development. hdevtools works by running a persistent process in the background, so that your Haskell modules remain in memory, instead of having to reload everything each time you change only one file. This is just like :reload in GHCi - with hdevtools you get the speed of GHCi as well as tight integration with your editor.

This is the Vim plugin that integrates Vim with hdevtools.