On 21/09/09 19:54, Tim Chase 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
>
> -tim

Or to make it "togglable", with the Vim default as default:

        if has('autocmd')
                au SwapExists * let v:swapchoice =
                        \ ((exists('g:swapchoice') &&
                        \ strlen(g:swapchoice) == 1 &&
                        \ 'oerdqa' =~# g:swapchoice) ?
                                \ g:swapchoice : "")
        endif

Best regards,
Tony.
-- 
What this country needs is a dime that will buy a good five-cent
bagel.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to