set nobackup nowritebackup
to your vimrc.
UPDATE with regards to Jason Lefler's answer
If you want to prevent your backup/undo/swap files to be created next to your edited file consider setting directories for them:
let &directory = expand('~/.vimdata/swap//')
let &backupdir = expand('~/.vimdata/backup//')
let &undodir = expand('~/.vimdata/undo//')
if !isdirectory(&undodir) | call mkdir(&undodir, "p") | endif
if !isdirectory(&backupdir) | call mkdir(&backupdir, "p") | endif
if !isdirectory(&directory) | call mkdir(&directory, "p") | endif
:h undodir to whatever you prefer. Note, there is double slash
// at the end (
~/.vimdata/swap//) needed to prevent collisions when you edit the same file names in different paths, e.g., there will be files like
C%%Users%%username%%docs%%awesome%%test.adoc~ created in
Then you create those directories if they don't exist.
.vimdata dir is what I use to have all of them in one place, you can change it of course.