On Tue, Sep 22, 2009 at 2:01 AM, Hari Krishna Dara <[email protected]>wrote:
> > On Mon, Sep 21, 2009 at 10:54 AM, Tim Chase <[email protected]> wrote: > > > >> project tree). When this is the case, some files will be opened by > DirDiff > >> in another vim, but it will report that files are opened by the first > vim > >> instance and ask me for a confirm. So I am thinking, in the later vim > >> instance, if I can however tell vim that all the further opened file > will be > >> automatically read-only, that will save my life. > >> > >> Can I do this in vim? Thanks. > > > > Of course :) > > > > :autocmd SwapExists * let v:swapchoice='o' > > > > You can read more about other options at > > > > :help SwapExists > > Why not just open the 2nd vim instance used for diff using the -R > option? I think this opens all files in readonly mode, so should not > cause the swap error. > > This makes sense. But sometime the 2nd vim instance is also an existing one and I don't want to exit it. So, I prefer to use Haria's solution. > -- > HTH, > Hari > > > > > -tim > > > > > > > > > > > > > > > -- Life is the only flaw in an otherwise perfect nonexistence -- Schopenhauer narke public key at http://subkeys.pgp.net:11371 ([email protected]) --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
