19

I'm currently using VSCode as my main editor, however, when I split the editor into 2, it opens the same file twice, like left & right (see image below).

enter image description here Is there any way to prevent it from opening the same file on the next editor? Currently, I have my custom settings and can be copied from here.

Neo Genesis
  • 707
  • 6
  • 20

1 Answers1

18

command name in Keybindings: workbench.action.moveEditorToNextGroup

command name in Command Palette: View: Move Editor into Next Group

default keybinding: Ctrl+Alt+


command name in Keybindings:workbench.action.moveEditorToPreviousGroup

command name in Command Palette: View: Move Editor into Previous Group

default keybinding: Ctrl+Alt+

enter image description here

Alex
  • 37,562
  • 12
  • 96
  • 100
  • thank bro! this helps for now. i hope vscode implement layouts in the future where you can set 2-3 columns or rows by ctrl+alt+2 or ctrl+alt+shift+2 like on sublime text. – Neo Genesis Jul 27 '17 at 08:33
  • You can split horizontally or vertically now but not simultaneously. Here's the issue tracking feature request: [grid support](https://github.com/Microsoft/vscode/issues/14909). – Alex Jul 27 '17 at 08:43
  • 6
    All I can say is "why the hell does it work like this at all". Having two instances of the same file open is just the last thing I'd expect. Who writes code on the same file in two places at the same time? – Bosworth99 May 08 '18 at 21:17
  • 1
    For Mac, its cmd + control + -> or cmd + control + – MikeL Jun 26 '18 at 00:49
  • 1
    @Bosworth99 A little OT, but [some want to see different parts of the same file at the same time](https://stackoverflow.com/questions/728949/open-two-instances-of-a-file-in-a-single-visual-studio-session). _I_ don't unless I'm diffing. Don't shoot the messenger. ;^) **More on topic**, how does this answer solve the problem? It moves the file into the previous/next tabset and "erases" the existing instance if a dupe is open, but you'll still get into the `duplicate tabs for same file` situation, right? Is there no way to prevent hitting this state to begin with? – ruffin May 01 '20 at 16:58