Friday, January 15, 2016

Re: detach current tab into a separate window

kamaraju kusumanchi wrote:
> On Fri, Jan 15, 2016 at 12:29 AM, kamaraju kusumanchi
> <raju.mailinglists@gmail.com> wrote:
>> On Thu, Jan 14, 2016 at 3:29 PM, Charles E Campbell
>> <drchip@campbellfamily.biz> wrote:
>>> kamaraju kusumanchi wrote:
>>>> Is it possible to detach the current tab in a gvim session into a
>>>> separate gvim window? Something akin to what firefox can do with tabs?
>>>>
>>>> Once the tab is separated, can I dock it back into the original gvim
>>>> window session?
>>>>
>>> You could try :Detach, which is available from
>>> http://www.drchip.org/astronaut/vim/index.html#DETACH .
>>>
>>> Note:
>>>
>>> * The code will handle multiple windows open in one tab by duplicating
>>> them in a new instance of gvim.
>>> * One must have two or more tabs open to :Detach a tab
>>> * One must have gvim available as an executable
>>> * Two separate, independent instances of vim result: they do not share
>>> variables, functions, etc.
>>>
>> Thank you Chris. I will give this a try.
>>
> When I tried to detach fileB.txt from the gvim window started by
> gvim -p fileA.txt fileB.txt
>
> there is a warning window saying
> Swap file ".fileB.txt.swp" already exists!
> the buttons below asks the user to choose one of "Open Read-Only",
> "Edit anyway", "Recover", "Quit", "Abort"
>
> Can you fix this?
>
Just tried this:

gvim -u NONE -N -p fileA.txt fileB.txt
:so [path]/Detach.vim
:Detach

and it worked correctly without any messages. The message you got
appears when you hold the file open in another instance of gvim and,
really, you don't want not to have it. Its telling you that changes
made to the file in one instance of gvim won't necessarily be reflected
in the other instance. Remember, the :Detach command starts up a new
instance of gvim; its not a separate thread sharing the same memory.
Vim does not support that.

Regards,
Chip Campbell

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment