I\'m using the Vim 7.3 feature undofile
the following way:
if version >= 703
set undofile
set undodir=$HOME/.vim/undo
set undolevels=1000
se
Because persistent undo was introduced with Vim 7.3, your version check is fine, and prevents errors in older Vims. Usually, you would check for the feature itself; :help 'undofile'
has this note:
{only when compiled with the |+persistent_undo| feature}
So the correct check (that also handles Vim 7.3 versions that were explicitly compiled without the feature) would be:
:if has('persistent_undo')
The reason that persistent undo has been implemented in core Vim is that this would be very difficult or even impossible to do in a plugin. Therefore, I know of no plugin that back-ports this functionality to Vim 7.2; I also don't see any motivation for such an endeavor, because the feature is non-essential and the solution is so simple: just upgrade to the latest Vim. If you have to administrative rights to install Vim on the system, you could compile or copy a user-local installation of Vim into your home directory.