It should come as no surprise to those who know me that I rely on Vim almost nearly always for any sort of text editing tasks. If you have used Vim before with little more than passing curiosity, you will have noticed and been annoyed by the swap file Vim creates when opening a file and the backup file that is created after committing changes to the file. While there is a very good reason why Vim does that by default, one which you may come to appreciate when things turn sour following a morning you woke up on the wrong side of bed on, it still is pretty annoying to have one extra file with a clumsy extension cluttering up the space whenever you open a file. Well, at least, it always does a splendid job of stomping on my nerves.
There is a way to get around to that, though. There is always a way. The following two directives which would go into the system-wide or user-specific “vimrc” file disable, respectively: a) creation of swap file whenever a file is opened using Vim; b) creation of a backup file whenever an opened file is altered and saved through Vim.
set noswapfile
set nobackup
I plucked these two from Vim Tip #907.