Sublime Forum

Override default key binding to allow sequence bindings

#1

I’m used to the combination of “ctrl+e,1”, “ctrl+e,2”, etc… to manage my layout (default in QtCreator). With sublime, there is already a default for “ctrl+e” that interrupts the sequence. I have tried setting “ctrl+e” in my default to the commands “noop” and “unbound” without success. Is there a way to do this?

example:
[
{ “keys”: [“ctrl+e”], “command”: “unbound” },
{ “keys”: [“ctrl+e,1”], “command”: “set_layout”, “args”: { “cols”: [0, 1], “rows”: [0, 1], “cells”: [[0, 0, 1, 1]] } },
{ “keys”: [“ctrl+e,2”], “command”: “set_layout”, “args”: { “cols”: [0, 0.5, 1], “rows”: [0, 1], “cells”: [[0, 0, 1, 1], [1, 0, 2, 1]] } }
]

0 Likes

#2

The problem here is not that the default key binding is getting in the way, it’s that you’re not correctly setting up the key sequence binding.

The keys array should be a list like ["key1", "key2"] but you have ["key1,key2"], so the key bindings don’t work because they’re not recognized as keys.

You want something more like this:

{ 
    "keys": ["ctrl+e","1"], "command": "set_layout", 
    "args": { "cols": [0, 1], "rows": [0, 1], "cells": [[0, 0, 1, 1]] } 
},
{ 
    "keys": ["ctrl+e","2"], "command": "set_layout", 
    "args": { "cols": [0, 0.5, 1], "rows": [0, 1], "cells": [[0, 0, 1, 1], [1, 0, 2, 1]] } 
},
0 Likes