Skip to content

Instantly share code, notes, and snippets.

@mattst
Last active January 24, 2024 22:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattst/64c8f3d7fbb0a7be27f38f05afb4a300 to your computer and use it in GitHub Desktop.
Save mattst/64c8f3d7fbb0a7be27f38f05afb4a300 to your computer and use it in GitHub Desktop.
Sublime Text layout additions for the Command Palette
[
// Add all the layouts from: Menu --> View --> Layout
{ "caption": "Set Layout: Single", "command": "set_layout",
"args": { "cols": [0.0, 1.0],
"rows": [0.0, 1.0],
"cells": [[0, 0, 1, 1]] } },
// Alternative name for the "Set Layout: Single" layout.
{ "caption": "Set Layout: Columns 1", "command": "set_layout",
"args": { "cols": [0.0, 1.0],
"rows": [0.0, 1.0],
"cells": [[0, 0, 1, 1]] } },
{ "caption": "Set Layout: Columns 2", "command": "set_layout",
"args": { "cols": [0.0, 0.5, 1.0],
"rows": [0.0, 1.0],
"cells": [[0, 0, 1, 1], [1, 0, 2, 1]] } },
{ "caption": "Set Layout: Columns 3", "command": "set_layout",
"args": { "cols": [0.0, 0.33, 0.66, 1.0],
"rows": [0.0, 1.0],
"cells": [[0, 0, 1, 1], [1, 0, 2, 1], [2, 0, 3, 1]] } },
{ "caption": "Set Layout: Columns 4", "command": "set_layout",
"args": { "cols": [0.0, 0.25, 0.5, 0.75, 1.0],
"rows": [0.0, 1.0],
"cells": [[0, 0, 1, 1], [1, 0, 2, 1], [2, 0, 3, 1], [3, 0, 4, 1]] } },
{ "caption": "Set Layout: Rows 2", "command": "set_layout",
"args": { "cols": [0.0, 1.0],
"rows": [0.0, 0.5, 1.0],
"cells": [[0, 0, 1, 1], [0, 1, 1, 2]] } },
{ "caption": "Set Layout: Rows 3", "command": "set_layout",
"args": { "cols": [0.0, 1.0],
"rows": [0.0, 0.33, 0.66, 1.0],
"cells": [[0, 0, 1, 1], [0, 1, 1, 2], [0, 2, 1, 3]] } },
{ "caption": "Set Layout: Grid 4", "command": "set_layout",
"args": { "cols": [0.0, 0.5, 1.0],
"rows": [0.0, 0.5, 1.0],
"cells": [[0, 0, 1, 1], [1, 0, 2, 1], [0, 1, 1, 2], [1, 1, 2, 2]] } },
// Add custom layouts - all 4 possible combinations of 3 panes
// Custom grid layout with 3 panes: left col 2 rows, right col 1 row.
{ "caption": "Set Layout: Grid: 3 (Left Col 2 Rows, Right Col 1 Row)", "command": "set_layout",
"args": { "cols": [0.0, 0.5, 1.0],
"rows": [0.0, 0.5, 1.0],
"cells": [[0, 0, 1, 1], [0, 1, 1, 2], [1, 0, 2, 2]] } },
// Custom grid layout with 3 panes: left col 1 row, right col 2 rows.
{ "caption": "Set Layout: Grid: 3 (Left Col 1 Row, Right Col 2 Rows)", "command": "set_layout",
"args": { "cols": [0.0, 0.5, 1.0],
"rows": [0.0, 0.5, 1.0],
"cells": [[0, 0, 1, 2], [1, 0, 2, 1], [1, 1, 2, 2]] } },
// Custom grid layout with 3 panes: top row 1 col, bottom row 2 cols.
{ "caption": "Set Layout: Grid: 3 (Top Row 1 Col, Bottom Row 2 Cols)", "command": "set_layout",
"args": { "cols": [0.0, 0.5, 1.0],
"rows": [0.0, 0.5, 1.0],
"cells": [[0, 0, 2, 1], [0, 1, 1, 2], [1, 1, 2, 2]] } },
// Custom grid layout with 3 panes: top row 2 cols, bottom row 1 col.
{ "caption": "Set Layout: Grid: 3 (Top Row 2 Cols, Bottom Row 1 Col)", "command": "set_layout",
"args": { "cols": [0.0, 0.5, 1.0],
"rows": [0.0, 0.5, 1.0],
"cells": [[0, 0, 1, 1], [1, 0, 2, 1], [0, 1, 2, 2]] } }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment