Let's say I recovered a bunch of swapfiles in quick succession:

gvim -r .swv
gvim -r .swu
gvim -r .swt

And then cycled through them all a few times before finding that one of them was nonsense. I want to now know which swap file is represented by this buffer of useless contents, so that I may delete it so as not to have known garbage floating around on my hard drive. How can I switch to that buffer/window and then query the name of the swapfile associated with that particular buffer?


1 Answer 1


This will show the filename of the swapfile for the current buffer. (For example: /c/path/.swu)

I found this (after a few tries) by typeing :swTAB.

I also found this question: VIM swap-file best practices?, which includes some other interesting and useful commands.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.