I use Vim to edit the output of shell commands all the time. Appending the dash in this line is second nature:
$ ./some-command | vim -
But every once in a while I get distracted and forget:
$ ./some-command | vim
This typically causes Vim to hang, pegs one core at 100% CPU, and may disrupt the terminal. Is there a way to fool-proof Vim for me?
vim
that checks for at least one argument before invoking the real vim with the arguments.