3 ms·
What specifically do you need fixed?
by sundarurfriend 2y ago
What specifically do you need fixed?
- amelius 2y agoWell, if I open the same file that I already opened in another terminal, then it shows me the PID of the Vim process and a question about removing the lock file. 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.
- konfekt 2y agoThere's the built-in `packadd editexisting` to take care of that; On Unix https://github.com/gioele/vim-autoswap https://github.com/gioele/vim-autoswap could be more convenient.
- amelius 2y agoThanks, but these only seem to work with graphical versions of Vim. Also, if you suspend your Vim session, these seem to stop working.
- konfekt 2y agoTry these work-arounds: - 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 "$@"