Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 2
    Nice answer. This one directly addresses the user's question, and offers a quick and elegant solution: redirect vim to /dev/tty! Simple! Commented May 10, 2016 at 23:49
  • I'm using Zsh; trap '...' exit fails but trap '...' EXIT appears to work. I don't know much about trapping, but my general approach for temporary files is to use mktmp [--suffix=...]. Also, vim <outfile> -c '...' >/dev/tty runs as normal until the file is loaded, then executes the given command chain, including :wq if you want to skip the editing phase. I also used set | grep -a EXIT and found signals=(EXIT ... DEBUG). Commented Jul 4, 2017 at 19:21