Yes - "killall vim".
This is more a shell specific question and not vim specific (so
there might be better ways with your prefered shell).
This will also kill vim jobs, that have not been opened that way.
Also killall on unix, does what it says. It sends a signal to all jobs
and works differently then on linux (just pointing out the obvious,
this might be confusing to someone).
But I admit, killall was also my first guess to the problem.
regards,
Christian
<...>
> vim c&
> ...
>
> Than I realized I need to close all of them. So I had to close them one by
> one:
>
> %1 and :qa!
> %2 and :qa!
> ...
>
> Is there a better way to close all files by issuing one command or one
> script?
If you are on zsh, you could use the following script:
emulate -L zsh
for job in ${(k)jobtexts[(R)vim*|view*]} ; do
kill -TERM "${${(s.=.)${(@s.:.)jobstates[$job]}[3]}[1]}"
# For unknown reason kill -TERM handling is delayed
# until foregrounding, so doing it here. `kill -KILL' is not
# though
%$job
endfor
Note that you could put this into function in ~/.zshrc, but you can't put it
into separate script that will run in another process.
Original message: