skip to Main Content

Sometimes i want to open the same file multiple tabs, each tab focusing on a different line/method, in Eclipse this is easy, but i haven’t found a way to do it in VSCode? screenshot from Eclipse doing it:
enter image description here

Split view isn’t enough, right now I’m on a 14" laptop with no extra display available, the laptop screen is too small to comfortably use split view.

4

Answers


  1. Chosen as BEST ANSWER

    Since Microsoft has no plans to implement the feature request, an alternative solution is to create a symlink of the file: ln -s code.c code.2ln.c and have *.2ln.c in .git/info/exclude then VSCode threats them as 2 different files, even though editing 1 of them is instantly reflected in the second (-:


  2. I don’t know if there is another solution, but this should work: Right click on the tab and then select Split [Up|Down|Left|Right]:

    Split edit window in VS Code

    Login or Signup to reply.
  3. You can do this by Split Editor feature in VS Code.

    Check the following image for details.

    enter image description here

    Login or Signup to reply.
  4. There is a clunky workaround in the feature request:

    1. In Explorer, right-click the target file, click "Select for Compare"
    2. right-click the same file, click "Compare with Selected"
    3. Toggle inline view for diff

    Some links with visual guide to achieve this:

    https://www.mytecbits.com/microsoft/dot-net/compare-contents-of-two-files-in-vs-code
    https://code.visualstudio.com/docs/getstarted/tips-and-tricks#_diffs

    P.S. This workaround however can only open 2 tabs of the same file concurrently within the same tab group

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search