This is a custom command to move the vim undo files together with the actual files. It's not perfect. One better solution would be to modify the coreutils mv source file.
Links
- http://vimdoc.sourceforge.net/htmldoc/options.html#'undodir'
- https://git.savannah.gnu.org/cgit/coreutils.git
- https://en.wikipedia.org/wiki/Mv#Examples
How to use
- Follow this answer
- Update VIM_UNDO_FILE on line 7 with your undodir path
- Make it executable: chmod +x mw
- Make it system-wide: mv mw /usr/bin