I use a vim persistent undo setup as follows, which have worked all that way here.
set undofile
set undodir=~/.vim/undodir
However now I'm facing a problem when the undofile became too long, notice that an undofile has a name in the form of absolute path like %home%user%directory%...%directory%file
that means if your file has a big name, is under a big path directory or both, the chances for reaching the linux file name max length will be higher. In my case, when try to save the open file it raises the error:
E828: Cannot open undo file for writing: /home/user/.vim/undodir/%home%user%workspace%%app%javascript%packs%domains%components%grid%column_cell_factory%inspection_cell_factory.jsx
How can I manage in order to keep my persistent undo working even for these situations?
UPDATE
This is not my real filename, I removed username and others personal information intentionally, at the end they are not relevant and don't contain any special char. The file length is 160, and the whole path with the folder it should be stored is 189 length.
I ran into the same problem, but luckily, there is a plugin to solve this problem:
https://github.com/pixelastic/vim-undodir-tree
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With