Sublime Forum

Custom Layout Tutorial needed! (cols, rows, cells)

#1

Can somebody please explain how to use “cols”, “rows”, “cells”?
I want to learn how to create custom layouts in sublime. Unfortunately one topic I found in this forum barely provided any information.
I am interested in “cols”, “rows” and “cells” arrays.

1. What every item means and how does it correspond to the other?

2. For example, I have this plugin to create a vertical split layout with the new tab created to the right, but I need the new tab created to the left of the active one. How can I modify the arrays?

def run(self): self.window.run_command('set_layout', {"cols":[0.0, 0.66, 1.0], "rows":[0.0, 1.0], "cells":[0, 0, 1, 1], [1, 0, 2, 1]]}) self.window.run_command('repl_open',{"type": "subprocess", "encoding": "utf8", "cmd": "python", "-i", "-u", "$file"], "cwd": "$file_path", "syntax": '\Packages\Python\Python.tmLanguage', "external_id": "python2.7" }) self.window.run_command('move_to_group', { "group": 1 })

0 Likes

#2

http://www.sublimetext.com/forum/viewtopic.php?f=6&t=7284&start=0&hilit=set+layout

0 Likes

#3

I mentioned this over there, but I’ll mention it over here too just in case. If you want to look at sample code check out:
github.com/SublimeText/Origami
I also wrote some stuff here:
github.com/SublimeText/Origami/issues/26

0 Likes

More than 4 columns?
More than 4 columns?