Thursday, January 5, 2023

Re: complement to T

On Thu, 5 Jan 2023 21:32:24 -0800 (PST)
scowles@ckhb.org wrote:
> is there a complement to <ctrl-w>T?
>
> i do file diffs in a split tab page and occassionally move one of the
> windows to a new tab page. is there any existing mechanism for
> moving a file in a tab page to an empty window in another tab page?

There is no existing mechanism, no. And I don't think there is any
concept of an "empty window" in Vim. I guess you're talking about
':new' windows with unnamed buffer ([No Name]).

In any case, you should be able to build yourself a function.

1. Get current buffer number (see ':h bufnr'). Say it's "3".
2. Move to the tab where you want to move the buffer (':norm! <n>gt'),
where "<n>" is an integer.
3. Split a window and open the buffer "3" (':split | b3').
4. Return.

--
Enan
3nan.ajmain@gmail.com
https://git.sr.ht/~enan/
https://www.github.com/3N4N

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20230106121250.08f20f8a%40cirdan.

No comments:

Post a Comment