diff options
author | Nathan Bouscal <nbouscal@gmail.com> | 2014-03-13 12:39:32 -0400 |
---|---|---|
committer | Nathan Bouscal <nbouscal@gmail.com> | 2014-03-13 12:39:32 -0400 |
commit | 1e1440be9da5bef11f7575e1aa7a91e32dd539e8 (patch) | |
tree | 43b4305501dc8c83c7fa6f117bb7fdc351d9ac8b /README.markdown | |
parent | 0770db2a0a80a3dd08318413faa7ea1116466716 (diff) | |
download | stylish-haskell-1e1440be9da5bef11f7575e1aa7a91e32dd539e8.tar.gz |
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.
Diffstat (limited to 'README.markdown')
-rw-r--r-- | README.markdown | 15 |
1 files changed, 15 insertions, 0 deletions
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 ----------------- |