by amelius · 1y ago · 0 comments
What I normally do is kill the PID, and then open the file again and tell Vim to remove the lock file.
This can be automated. But even better would be to allow me to take over the session in case there were any unsaved changes.
- either adding to your `:help vimrc`
if has('clientserver') && empty(v:servername) try call remote_startserver('VIM-' . getpid()) catch '^Vim\%((\a\+)\)\=:E\%(941\|240\)' endtry endif
- or, at least on Unix, calling vim by, say `$HOME/bin/vim` with `$HOME/bin` in `$PATH` and launching
/usr/bin/vim --servername vim -u ~/.vim/vimrc "$@"