##What is a .un~ file or or why does Vim in the Terminal make the .un~ file?
:set noundofile
By default this option is turned off.
You have explicitly enabled the undofile option in one of the initialization files.
If you want your undofiles to be stored only in a particular directory, you can point the undodir
option to a directory that will contain all your aggregated undofiles.