Atualização 28-06-2015 : Corrigi um pequeno bug e o liberei como um plug-in . O código do plugin é um pouco melhor, pois avisa novamente depois de mover o cursor; Eu recomendo que você use o plugin.
A resposta do superjer funciona muito bem, mas tem o efeito colateral infeliz de que você só pode desfazer alterações da última sessão do Vim, e nem todas as sessões anteriores do Vim.
Isso ocorre porque wundosubstitui o arquivo de desfazer; não é mesclado. Tanto quanto eu sei, não há como corrigir isso.
Portanto, aqui está minha solução alternativa: ela exibirá uma grande mensagem de aviso em vermelho quando você estiver desfazendo alterações no arquivo de desfazer.
Isso é semelhante à resposta de Ingo Karkat , mas não requer um plug-in externo e possui algumas diferenças sutis (exibe aviso em vez de bipe, não é necessário pressionar uduas vezes).
Nota que este apenas modifica o ue <C-r>se liga, e não o U, :undoe :redocomandos.
" Use the undo file
set undofile
" When loading a file, store the curent undo sequence
augroup undo
autocmd!
autocmd BufReadPost,BufCreate,BufNewFile * let b:undo_saved = undotree()['seq_cur'] | let b:undo_warned = 0
augroup end
" Remap the keys
nnoremap u :call Undo()<Cr>u
nnoremap <C-r> <C-r>:call Redo()<Cr>
fun! Undo()
" Don't do anything if we can't modify the buffer or there's no filename
if !&l:modifiable || expand('%') == '' | return | endif
" Warn if the current undo sequence is lower (older) than whatever it was
" when opening the file
if !b:undo_warned && undotree()['seq_cur'] <= b:undo_saved
let b:undo_warned = 1
echohl ErrorMsg | echo 'WARNING! Using undofile!' | echohl None
sleep 1
endif
endfun
fun! Redo()
" Don't do anything if we can't modify the buffer or there's no filename
if !&l:modifiable || expand('%') == '' | return | endif
" Reset the warning flag
if &l:modifiable && b:undo_warned && undotree()['seq_cur'] >= b:undo_saved
let b:undo_warned = 0
endif
endfun