Sublime Forum

Split window twice

#1

Hey everyone!

It’d be great if there was an option to do a secondary window split, e.g.: 2 verticals, resulting in 3 areas, but the right one should be split horizontally itself, resulting in a total of 4 areas (just an example and not the same as the builtin 4 areas mode with connected separators).

Best wishes,
Shu

0 Likes

#2

Layout of groups can be defined using set_layout command.

To create a Command Palette item …

  1. create or open Packages/User/Default.sublime-commands
  2. add the following content
[
    // ...

    {
        "caption": "View Layout: 3 Cols (with 2 rows in 3rd column)",
        "command": "set_layout",
        "args":
        {
            "cols": [0.0, 0.33, 0.66, 1.0],
            "rows": [0.0, 0.5, 1.0],
            "cells":
            [
                [0, 0, 1, 2], [1, 0, 2, 2], 
                [2, 0, 3, 1], [2, 1, 3, 2]
            ]
        }
    },

    // ...
]
1 Like

#3

Thanks for the reply, @deathaxe !
That sounds great! Unfortunately, I guess I haven’t found a way to access said file (or have I?). I tried opening it from Tools -> Developer -> Defaults (or something similar, I’m on my phone right now) , but it only showed an empty page. Or is this to be expected and it’s empty if never modified?

0 Likes

#4

Use Preferences > Browse Packages from the menu or command palette; the User folder in the window that opens is where you should create the file (there is not a file by that name by default in your User package; putting one there is how you add commands to the command palette).

0 Likes

#5

I see! Thanks for clarifying! That’s like the keynapping file I created. However, and I don’t know why, this still doesn’t work.
Even when I copy & paste the data from
“Default/Default.sublime-commands” (readonly) to
“User/Default.sublime-commands” and edit the data within the latter file, I don’t get anything different. Neither when I edit the existing code, nor when adding the new one for a new view. Strange. I’m on macOS, ST 4126. Tried restarting ST to no avail.
EDIT:
Alright, found it:
Main.sublime-menu is required for this to show in the menu.

0 Likes