Skip to content
Browse files

Added Haskell type function bound to leader tt.

Thanks to Sebastian Visser.
  • Loading branch information...
1 parent 93dbf7e commit 7547f9ed5cd989e80530d36f0ad3225ecacd6dcb John MacFarlane committed Oct 27, 2011
Showing with 16 additions and 0 deletions.
  1. +16 −0 vimrc
View
16 vimrc
@@ -273,6 +273,22 @@ map <Leader>ui :call UploadICAL()<cr>
" ,cd changes working directory to directory of file being edited
map ,cd :cd %:p:h<CR>
+" Haskell type signatures - from S. Visser
+
+function! HaskellType()
+ w
+ execute "normal {j^YP"
+ execute (".!ghc -XNoMonomorphismRestriction -w % -e \":t " . expand("<cword>") . "\"")
+ redraw!
+endfunction
+
+function Haskell()
+ map <buffer> <silent> tt :call HaskellType()<Cr>
+ " more haskell stuff here
+endfunction
+
+autocmd BufRead,BufNewFile *.{ag,hs,lhs,ghs} call Haskell()
+
"-----------------------------------------------------------------------
" Custom digraphs

0 comments on commit 7547f9e

Please sign in to comment.
Something went wrong with that request. Please try again.