Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code: Hotkey to move a tab from its current location to the very front?

Sometimes I have 20+ file tabs open and I want to move the one i'm currently working on to the very front. Dragging and dropping takes too long. Is there a hotkey to do this in?

From this enter image description here

To this enter image description here

like image 594
MalcolmInTheCenter Avatar asked Jan 04 '19 21:01

MalcolmInTheCenter


People also ask

How do you move tabs in VS code?

You can switch between views using ctrl + 1 ( ⌘ + 1 ), ctrl + 2 ( ⌘ + 2 ), and so on. Alternatively, you can switch between tabs (and, by extension, between views) using ctrl + page up / page down ( ⌘ + page up / page down ).

What does Ctrl Shift P do in Vscode?

1. Ctrl+Shift+P, F1 ⮕ Show Command Palette. This shortcut opens the command palette in the vs-code, where we can search for the other commands.


1 Answers

EDIT!

A quick look at the short-cut menu revealed this shortcut: Move Editor Left. This will move the current tab one space to the left, and is pretty quick to move the tab to the front.

The default key binding for this in Windows is Ctrl+Shift+PageUp while the Move Editor Right key command on Windows is Ctrl+Shift+PageDown.

The default key binding for Move Editor Left on macOS is ⌘K ⇧⌘← while the default for the Move Editor Right command is ⌘K ⇧⌘→

Unfortunately, there doesn’t seem to be a command to move the editor to the first tab.


This isn't completely automated, but it is a bit faster than a simple drag & drop.

Right click on the tab you want to move and select Split [Up, Down, Left, Right] (whichever you prefer)

Right Click on desired tab

After you do this, on the other page, scroll to the first tab, select it. (This is important!), then click on your split out tab and drag it over to the front.

Drag desired tab to the front

Again, it isn't a (much more desirable) short-cut, but it works well enough for now.

like image 91
Jack Avatar answered Sep 28 '22 02:09

Jack