Sublime Forum

What about ["space","space"] Keybinding?

#1

Hey guys,
there probably is a keybinding posted somewhere, or a plugin written that deals with what I am trying to do.

At least in HTML, CSS and JS Sublime will by default add the second Quotation mark whenever typing the first.
That’s great, but as much as this tries to speed up my coding, it slows me down whenever I want to “escape the String”.

So I read the docs on keybindings, and came up with the one below.

{ "keys": "ctrl+space","ctrl+space"], "command": "move", "args": { "by": "characters", "forward": true } }

I know that this interferes with autocompletion dialogs and I haven’t yet gotten to the point of defining the right context, which should be something like * following_text / equal / “”"*
It works so far, but i actually wanted to use pressing space twice “space”,“space”] as the key commands. But it’s not working, while “a”,“a”] or something similiar does work.

Am I doing something wrong here, or is space space something that can’t be used?

Thank you very much?!

0 Likes

#2

It kinda works with “keys”: " “,” "],

0 Likes

#3

That’s pretty cool! It actually removes the first space when it detects that the key combination triggers a binding and then runs it. The timeout seems to be at roughly 2s from my testing.

Now, what is weird though is that the spacebar has a different repesentation in a binding that involves a modifier (ctrl+space) than without ().

0 Likes

#4

I know I am a few days late to replay, but thanks for the reply. Works great. I use this binding a lot!
So just for the record - this would be the key-binding i was looking for.
{
“keys”: " “,” "],
“command”: “move”,
“args”:
{
“by”: “characters”,
“forward”: true
}
}

0 Likes

#5

Great, I was thinking that this keybinding can be chained with SwiftKey from the Android device, then when pressing space multiple time it can code by itself:P

0 Likes

#6

“I am a beautiful person who is the best way to avoid defending yourself to the user to the user to the user to the user…”

(This is what spacing out looks like on my SwiftKey currently. It’s not exactly ready to ship :smile: )

0 Likes

#7

This stopped working with Build 3038 (ST3)

can somebody tell me why or better help me fix it?

thanks a bunch

{ "keys": " "," "], "command": "move", "args": { "by": "characters", "forward": true } }

0 Likes