Skip to content

adambaker/haskell-vim-now

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Haskell Vim IDE


Installation

One command does it all:

curl -o - https://raw.githubusercontent.com/begriffs/haskell-vim-now/master/install.sh | bash

In less than ten minutes your Vim will transform into a beautiful Haskell paradise. (Don't worry, it backs up your original configuration.) It also builds all necessary support binaries including codex, hscope, ghc-mod, hasktags, hoogle and more.

No more wading through plugins trying to make them all work together. In ten minutes you will have a fully functional Vim that looks great and lets you

  • inspect types
  • evaluate Haskell
  • lint and check
  • manipulate tags
  • hoogle lookup
  • pointfree refactor
  • tab compelete
  • unicode symbols
  • highlight DSLs
  • work with git

Installation Troubleshooting

See this wiki page for tips on fixing installation problems.

Keybindings and commands

The commands are organized into logical groups to help you remember them.

Types, autocomplete, and linting

<Tab>Autocomplete with words in file
<C-space>Autocomplete with symbols in your Cabal sandbox
,htShow type of expression under cursor
,hTInsert type of expression into previous line
,hlRun Haskell linter on file
,hcRun Haskell compile check on file
,<cr>Clear type selection

Hoogle

,hhRun Hoogle on the word under the cursor
,hHRun Hoogle and prompt for input
,hiRun Hoogle for detailed information on word under cursor
,hIRun Hoogle for detailed information and prompt for input
,hzClose the Hoogle search window

GHCI repl

If you open a tmux terminal alongside MacVim then you can send Vim selections to it. This works well for evaluating things in GHCI.

,rsSend selected text to tmux
,rvChange tmux session, window, and pane attachment

Git

,g?Last-committed files (Monday morning key)
,gsGit status (fugitive)
,ggGit grep
,glGit log (extradition)
,gdGit diff
,gbGit blame

Commenting

gcComment / Uncomment selection

Aligning

,a=Align on equal signs
,a,Align on commas
,a|Align on vertical bar
,apAlign on character of your choice

Splits and find file

,<space>Fuzzy file find (CtrlP)
,fToggle file browser, find file
,FToggle file browser
,sjOpen split below
,skOpen split above
,shOpen split leftward
,slOpen split rightward

Tags

,tgGenerate tags with codex
,ttOpen/close the tag bar
C-]Jump to definition of symbol (codex + hasktags)
C-\Show uses of symbol (hscope)

Conversions

,h.Transform visual selection to pointfree style
,h>Transform visual selection to pointed style

Buffers

,bpPrevious buffer
,bnNext buffer
,b<space>Buffer fuzzy finder
,bdDelete buffer, keep window open (bbye)

Misc

,maEnable mouse mode (default)
,moDisable mouse mode
,igToggle indentation guides
,uInteractive undo tree
,ssEnable spell checking
,eOpen file prompt with current path
,<cr>Clear search highlights
,rRedraw screen
C-hMove cursor to leftward pane
C-kMove cursor to upward pane
C-jMove cursor to downward pane
C-lMove cursor to rightward pane (redraw is `,r` instead)
gqFormat selection using `stylish-haskell` for haskell buffers (`par` for others)

(If you prefer to restore the default screen redraw action of C-l then add unmap <c-l> to your .vimrc.local)

Customizing

After installing this configuration, your .vimrc and .vim will be under version control. Don't alter these files. Instead, add your own settings to ~/.vimrc.local and ~/.vim.local/bundles.vim.

Adding Custom Bundles

Vundle requires all Bundle statements to be given at once. To accommodate this restriction, .vimrc sources ~/.vim.local/bundles.vim immediately after its own Bundle statements.

Bundle statements made elsewhere are not recognized.

About

One-line Haskell Vim install

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 79.9%
  • Shell 20.1%