I use Vim in Screen. I run the command
vim <bigFolder>
I am in stuck, since it does not make sense to close each buffer by
:q
How can you close all active buffers in Vim, by one command inside Vim?
I use Vim in Screen. I run the command
vim <bigFolder>
I am in stuck, since it does not make sense to close each buffer by
:q
How can you close all active buffers in Vim, by one command inside Vim?
That doesn't save the buffers though. Maybe :wqall! :xall! is a little better.
:on
will close all buffers except the one you are currently editing (the cursor is inside this buffer).
:on!
will also close modified buffers but these will become hidden buffers.
:ls
will lists all the buffers with their status (hidden, ...)
Some help:
:h only
:h hidden-buffer
:h ls
If you happen to get VIM completely stuck you should still be able to kill it from outside VIM.
kill %vim
ps
. The you can kill it:$ ps -f -C vim
UID PID PPID C STIME TTY TIME CMD
nfellman 27273 7473 0 Jun24 pts/15 00:00:00 /nfs/iil/home/nfellman/vim/bin/vim a.pl
nfellman 37213 23747 0 Jun23 pts/15 00:00:00 /nfs/iil/home/nfellman/vim/bin/vim b.pl
So if I want to kill the VIM that's editing a.pl
you can do:
kill -9 27273
This should work even inside screen
The :bufdo
command lets you execute a command on all buffers. In this case, you want to run :bufdo bdelete
to close all open buffers in one go.