hakluke/how-to-exit-vim

The Windows Way

airstrike opened this issue · 7 comments

:!taskkill.exe /f /im vim.exe

Damn, windows api is cleaner than linux.That's much better than ps into grep into awk into kill

Oh, nevermind

pkill vim

#72

jdebp commented

NAK. Does not employ the for command. Or Powershell.

Damn, windows api is cleaner than linux.That's much better than ps into grep into awk into kill

In fairness, piping grep to awk is almost always redundant. You could do it without the pipes by using $() as in :! for i in $(grep -l vim$ /proc/*/comm | cut -d/ -f3); do kill $i; done This also has the advantage of killing ALL your vim instances, including the ones you suspended using the 'suspend' method...

I'd rather shutdown my computer than come up with that command.

my command is pretty dang simple compared to some of the suggested methods...and cleaner than all the pipes (though I did have to pipe inside the $() you could do away with the pipes entirely by using pgrep, but at that point :! pgrep vim | xargs kill -9 is simpler. I was just trying to help you avoid pipes, since that was the core of your objection...