Customizing Sublime Text 2's Multi Pane Workflow

October 31, 2012

If you're like me then you spend most of your day buried in Sublime Text 2 tabs spit across multiple panes. This is amazingly efficient as it gives you the ability to look at multiple files side by side without having to switch tabs every time you want to reference something. I usually work in a 2 pane layout split vertically. I find myself using one pane primarily for reference material with the other being used for actual editing. Unless I'm using a big monitor, this usually means that I'm constantly resizing the amount of space that one pane has over the other to make room for reading/writing code. Previously I did it the old fashioned way, by pointing my mouse to the center line and dragging every time I needed a bit more room. That all stopped when I took some time to customize ST2's powerful keybinding system… With a simple keystroke I can now resize windows from the normal 50/50 slit panes to 33/66 ***command+option+left*** or 66/33 ***command+option+right***. To bring civility back its a quick touch of ***command+option+up*** and everything is back to 50/50. This is all done by adding the following blocks to "Prefrences -> Key Bindings - User"

Sublime Text 2 Keybindings to Resize Split Panes
Sublime Text 2 Keybindings to Resize Split Panes. GitHub Gist: instantly share code, notes, and snippets.
[
    {
        "keys": ["super+alt+left"],
        "command": "set_layout",
        "args":
        {
            "cols": [0.0, 0.33, 1.0],
            "rows": [0.0, 1.0],
            "cells": [[0, 0, 1, 1], [1, 0, 2, 1]]
        }
    },
    {
        "keys": ["super+alt+right"],
        "command": "set_layout",
        "args":
        {
            "cols": [0.0, 0.66, 1.0],
            "rows": [0.0, 1.0],
            "cells": [[0, 0, 1, 1], [1, 0, 2, 1]]
        }
    },
    {
        "keys": ["super+alt+up"],
        "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]]
        }
    },
    {
        "keys": ["super+alt+down"],
        "command": "set_layout",
        "args":
        {
            "cols": [0.0, 1.0],
            "rows": [0.0, 1.0],
            "cells": [[0, 0, 1, 1], [1, 0, 2, 1]]
        }
    },
    { "keys": ["ctrl+shift+left"], "command": "move_to_group", "args": { "group": 0 } },
    { "keys": ["ctrl+shift+right"], "command": "move_to_group", "args": { "group": 1 } }
]

You'll also notice in those bindings that we have three additional commands: - ***command+option+down*** - turns the split screen into a single pane (useful when going from a big monitor to a single laptop screen) - ***control+shift+left*** - moves the current active file to the left pane - ***control+shift+right*** - moves the current active file to the right pane (when there is one) Hopefully you'll find these bindings as helpful as I have. Feel free to share your own in the comments below!

Monitor your DNS Zones with ZoneWatcher

Be alerted of DNS record changes moments after they happen, not from upset customers.

ZoneWatcher screenshot