From 1e1440be9da5bef11f7575e1aa7a91e32dd539e8 Mon Sep 17 00:00:00 2001 From: Nathan Bouscal Date: Thu, 13 Mar 2014 12:39:32 -0400 Subject: Add better vim integration to readme Add instructions to integrate into vim such that it runs stylish-haskell automatically whenever you save a .hs file. --- README.markdown | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index d5af4fe..5cd3272 100644 --- a/README.markdown +++ b/README.markdown @@ -100,6 +100,21 @@ Just call or add a keybinding for it. +To run stylish-haskell each time you save a .hs file, add this to your .vimrc: + + augroup stylish-haskell + autocmd! + autocmd BufWritePost *.hs call s:StylishHaskell() + augroup END + + function! s:StylishHaskell() + let cursor_position = getpos('.') + undojoin + %!stylish-haskell + call setpos('.', cursor_position) + endfunction + + Emacs integration ----------------- -- cgit v1.2.3