Skip to content

Instantly share code, notes, and snippets.

@5eleven
Created July 4, 2012 09:07
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save 5eleven/3046228 to your computer and use it in GitHub Desktop.
Save 5eleven/3046228 to your computer and use it in GitHub Desktop.
Sublime Text 2 Layout: Grid: 6
// "Cols" and "Rows" specify the coordinates in x and y.
// Cells create cells by indexing the rows and cols array in the order [startx, starty, endx, endy].
// Edit your Main.Sublime-menu file
// Mac: /Users/yourMacName/Library/Application Support/Sublime Text 2/Packages/Default
// PC: C:\Users\yourPCName\AppData\Roaming\Sublime Text 2\Packages\Default
// Example Below:
{
"caption": "Grid: 6",
"command": "set_layout",
"args":
{
"cols": [0.0, 0.33, 0.66, 1.0],
"rows": [0.0, 0.5, 1.0],
"cells":
[
[0, 0, 1, 1], [1, 0, 2, 1], [2, 0, 3, 1],
[0, 1, 1, 2], [1, 1, 2, 2], [2, 1, 3, 2]
]
}
}
@Sawtaytoes
Copy link

In your Key Bindings configuration file. You can find it by going to Preferences > Key Bindings. You will want to assign it to a key. Look at the default keys on the left-side that you can use as a template.

@jlehtinen
Copy link

jlehtinen commented Apr 12, 2018

Grid of 9 cells:

[
  {
    "caption": "Grid: 9",
    "keys": ["super+alt+7"],
    "command": "set_layout",
    "args":
     {
      "cols": [0.0, 0.33, 0.66, 1.0],
      "rows": [0.0, 0.33, 0.66, 1.0],
      "cells": 
      [
          [0, 0, 1, 1], [1, 0, 2, 1], [2, 0, 3, 1],
          [0, 1, 1, 2], [1, 1, 2, 2], [2, 1, 3, 2],
          [0, 2, 1, 3], [1, 2, 2, 3], [2, 2, 3, 3],
      ]
    }
  },
  {
    "caption": "Grid: 12",
    "keys": ["super+alt+8"],
    "command": "set_layout",
    "args":
     {
      "cols": [0.0, 0.25, 0.5, 0.75, 1.0],
      "rows": [0.0, 0.33, 0.66, 1.0],
      "cells": 
      [
          [0, 0, 1, 1], [1, 0, 2, 1], [2, 0, 3, 1], [3, 0, 4, 1],
          [0, 1, 1, 2], [1, 1, 2, 2], [2, 1, 3, 2], [3, 1, 4, 2],
          [0, 2, 1, 3], [1, 2, 2, 3], [2, 2, 3, 3], [3, 2, 4, 3]
      ]
    }
  }
]

Why? For the sole purpose of teasing my colleague who swears by a single cell, even though these fit comfortably on a retina iMac screen for some small files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment