• spartanatreyu@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    8 months ago

    What do you mean by:

    There is no way to split a tab into windows in VSCode.

    Do you mean, drag a tab out of a window to create a new window? Because if so, you can do that in vscode.

    • azertyfun@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      8 months ago

      No, literally have one tab with multiple windows inside it (the default for vim).

        tab 1  |   tab 2   
      w1 | w2  | w1 | w2
      w3 | w4  |    w3   
      
      • spartanatreyu@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        8 months ago

        I’m assuming for your example that only one tab is shown at a time?

        In that case, you can do that in vscode, the only difference is the semantics of what is considered a “window”, and what is considered a “tab”.

        To do this in vscode:

        Have one window with four panes, and another window with three panes:

                                 
                Window 1         
         ┌──────────┬──────────┐ 
         │          │          │ 
         │  Pane 1  │  Pane 2  │ 
         │          │          │ 
         ├──────────┼──────────┤ 
         │          │          │ 
         │  Pane 3  │  Pane 4  │ 
         │          │          │ 
         └──────────┴──────────┘ 
                                 
                Window 2         
         ┌──────────┬──────────┐ 
         │          │          │ 
         │  Pane 1  │  Pane 2  │ 
         │          │          │ 
         ├──────────┴──────────┤ 
         │                     │ 
         │       Pane 3        │ 
         │                     │ 
         └─────────────────────┘ 
                                 
        

        You can then switch between your windows (or “tabs” in your example) by keyboard shortcut.

        In vscode, you can make the Panes different files, or even different views of the same file.

        • azertyfun@lemmy.blahaj.zone
          link
          fedilink
          English
          arrow-up
          1
          ·
          8 months ago

          You mean a whole different window at the OS level? That’s just a way inferior hack to the way vim does it by default.

          I’ve found an issue from 2017 about it and this related one that focuses more specifically on supporting vim-like behavior. This is just, fundamentally, something that VSCode doesn’t implement simply because of technical limitations. The extensions that attempt to recreate this behavior are apparently all quite janky.

          I mean I don’t care, I’m very happy with vim now. But the terribly naive tab support is the reason I left vscode for vim initially. People who have only known “vscode-like” tabs don’t know what they are missing out on.

          • spartanatreyu@programming.dev
            link
            fedilink
            arrow-up
            1
            ·
            8 months ago

            You mean a whole different window at the OS level?

            Yes, that way I could switch between windows in a single shortcut, or even place them side by side so I can see both at the same time with other shortcuts.

            That’s just a way inferior hack to the way vim does it by default.

            Can you explain this more?

            Why wouldn’t you want window management to be managed by the window manager?

            • azertyfun@lemmy.blahaj.zone
              link
              fedilink
              English
              arrow-up
              1
              ·
              7 months ago

              Sorry, I didn’t log into this account for a while.

              Anyways, I guess in an ideal world the window management could be done fully via the window manager. In practice this doesn’t work too well, because that would require a more complex protocol than currently exists. For VSCode for instance, that would require disabling the native tabbing feature (but keeping the native splitting because otherwise I’ll end up with duplicated panes such as the file list) and implementing something custom to translate tab operations to sway-wm operations (in my case).

              I guess it could work but it’s not supported OOTB, and after a lot of work is probably going to end up being a lot more clunkier than what I have going on in vim.