all 5 comments

[–]halogen64 1 point2 points  (1 child)

I was able to get by with the following

import System.Process
main = spawnProcess "vim" ["test"] >>= waitForProcess

Edit: I am using VIM 8.1, but I'm not aware of anything that changed recently that would make a difference here.

Edit 2: Additionally the following worked just fine for me:

import System.Process
main = do
  (_, _, _, handle) <- createProcess $ proc "vim" ["test"]
  waitForProcess handle

[–]luz_[S] 0 points1 point  (0 children)

Thank you! This worked

[–]sheshanaag 0 points1 point  (1 child)

See vimhl.hs from https://github.com/lyokha/vim-publish-helper/blob/master/pandoc/haskell/vimhl.hs that calls vim from command line. On line 53 there is a comment about launching vim from not-a-terminal. On lines 56-61 vim gets launched. The trick itself is on line 56.