Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Handle better the case when same file is opened in two different running Vims #12

Closed
y opened this Issue Sep 26, 2012 · 4 comments

Comments

Projects
None yet
3 participants

y commented Sep 26, 2012

Most of the time when recover kicks in it's not because of a stale swap file from a dead Vim process, it's when I forget there's a Vim process already open with a file and try to edit the same file in a different Vim process. For those cases it would make sense to not see this:

Swap File found: Diff buffer? 
[Y]es, (N)o, (A)bort: 

and after choosing abort, I'm faced with another choice to abort:

Swap file "file.swp" already exists!

[O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:

This is a probably a common case, so it should be made easier by asking a single question, something like:

Already editing the same file in a different process.
Open the file here in read-only mode?
[Y]es, (N)o, (A)bort:
Owner

chrisbra commented Sep 26, 2012

On Wed, September 26, 2012 17:56, y wrote:

Most of the time when recover kicks in it's not because of a stale swap
file from a dead Vim process, it's when I forget there's a Vim process
already open with a file and try to edit the same file in a different Vim
process. For those cases it would make sense to not see this:

Swap File found: Diff buffer?
[Y]es, (N)o, (A)bort:

and after choosing abort, I'm faced with another choice to abort:

Swap file "file.swp" already exists!

[O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:

This is a probably a common case, so it should be made easier by asking a
single question, something like:

Already editing the same file in a different process.
Open the file here in read-only mode?
[Y]es, (N)o, (A)bort:

That is an interesting question. Unfortunately, there is no support in
vimscript to see, whether the file you want to open is already being
edited in another vim session. This should possibly be added to vim.

I'll try to create a patch for Vim. Once that is included in Vim, I'll
modify Recover.vim accordingly.

regards,
Christian

rking commented Oct 13, 2012

👍 on this.

I could hack together a thing that would work on Linux (and probably other *nices) in the meantime, if you want.

Owner

chrisbra commented Oct 23, 2012

Well, if you can hack something together, I'll might include it.

Owner

chrisbra commented Nov 21, 2012

Have included a hack for unix Vim. Check commit 8a6859f

@chrisbra chrisbra closed this Nov 21, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment