On Jul 24, 5:25 pm, smu johnson <[email protected]> wrote:
> Hi,
>
> My brother and I together found something that could be a problem with Vim,
> maybe not a bug, but a possible headache.
>
> My brother was editing a file that he only had permissions to, and when I
> went to go edit it at the same time as he was (without knowing), it didn't
> give me the .swp file warning that he was editing it which I rely on
> heavily.
>
> After a bit of troubleshooting, we found it that I wasn't getting .swp
> warnings on files that I didn't have permission to, only a RO flag.
>
> Is there a way to make vim always warn on a .swp file thing, even if the
> file flag is RO read-only?
>

If you don't have write privileges, why does it matter that the file
is being edited by someone else at the same time you're viewing it?
Vim will automatically check if a file has been modified and allow you
to reload it whenever it regains focus, or you execute a shell
command, or you run the :checktime command.

Relying on the swap file warning message is a bad idea anyway, because
the swap file will not be in the same place if either of you have set
the 'directory' option to a different value.

I did a :helpgrep .*read-\?only\&.*swap and only found six
occurrences. From these I discovered that since version 5, a swap file
is not created for readonly files unless it won't fit into memory.

While it is probably *possible* to use the 'maxmem' option to force
Vim to use a swap file for your file, I would certainly not recommend
this (and I'm sure there will be other side effects). Instead, I might
(for this file, or for all files) set up a CursorHold autocmd to
run :checktime.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to