vimtricks.wiki Concise Vim tricks, one at a time.

How do I move the current split into a new tab and immediately jump back to the previous tab?

Answer

<C-w>TgT

Explanation

When a split temporarily becomes the center of attention, promoting it to its own tab can reduce layout noise. <C-w>TgT gives you a quick pivot pattern: extract the active window to a new tab, then hop back to your prior tab to continue parallel work.

How it works

  • <C-w>T moves the current window into a new tab page
  • gT jumps to the previous tab page

The first key sequence is structural: it lifts one split out of the current window grid. The second is navigational: it restores your original tab context immediately. Together, this avoids losing orientation while still creating focused space for deeper edits.

Example

Before:

Tab 1 has three splits: test file, implementation, and notes

Run in the notes split:

<C-w>TgT

After:

Notes now live in a dedicated tab, and you are back in Tab 1

Tips

  • Use gt after this sequence when you want to revisit the extracted tab quickly
  • This is useful during reviews: isolate a noisy scratch split, then return to the main editing tab without rebuilding window layouts

Next

How do I uppercase only the text inside braces using a visual text object?