Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom layouts, Sublime text 2

Tags:

I've been working with a 2 column system so far but feel I'm needing a third and that 3 spread across the screen doesn't give much of a view without adjusting the width every time.

It's there a way to get the grid layout but have the bottom half of the screen one file. I know it's a long shot but wondering if anyone knows of anything Current system

Found that you can edit for custom layouts in Packages/default/Main.sublime-menu Having problems saving though error in trying to parse file: expected value in ~/library/application support/sublime text 2/packages/default/Main.sublime-menu:407:21

Edited: for better layout

Found something that is similar, been trying to mod it but don't understand how the cells work

This one is similar

"args": {     "cols": [0.0, 0.5, 1.0],     "rows": [0.0, 0.5, 1.0],     "cells": [         [0, 0, 1, 2], // (0.0, 0.0) -> (0.5, 1.0)         [1, 0, 2, 1], // (0.5, 0.0) -> (1.0, 0.5)         [1, 1, 2, 2]  // (0.5, 0.5) -> (1.0, 1.0)     ] } 

which gives

Code

like image 447
Bankzilla Avatar asked Oct 31 '12 00:10

Bankzilla


2 Answers

Assuming these are just coordinates with 0,0 at the upper left, something like this should work:

[0, 0, 1, 1], [1, 0, 2, 1], [0, 1, 2, 2] 


Edit: Just tested, and it does.

Create the file Main.sublime-menu in your Packages > User folder (best to leave the default menu alone) and put the following code in it:

[{     "id": "view",     "children": [{         "id": "layout",         "children": [{              "command": "set_layout",              "caption" : "Custom: 3 Pane",              "mnemonic": "C",              "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]                 ]             }         }]     }] }] 

You will see Custom: 3 Pane in your layout options. No need to restart Sublime Text.

For anyone interested, here is a gist containing this layout as well as a flipped version.

like image 81
Sara Avatar answered Sep 19 '22 15:09

Sara


This was very helpful for visualizing what points the coordinates are referring to: http://www.sublimetext.com/forum/viewtopic.php?f=6&t=7284&start=0&hilit=set+layout

like image 20
Johnny5k Avatar answered Sep 18 '22 15:09

Johnny5k