Note that there are some explanatory texts on larger screens.

plurals
  1. POSublime Keymap - shift+space to go back one character in given context
    primarykey
    data
    text
    <p>On my sublime-keymap file I already have this:</p> <pre><code>{ "keys": ["shift+space"], "command": "move", "args": {"by": "characters", "forward": true}, "context": [ { "key": "following_text", "operator": "regex_contains", "operand": "^[ )'\"\\}\\]&gt;: ]", "match_all": true }, { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] } </code></pre> <p>So, when my cursor is before any of these characters <strong>)}]:;></strong> the shift+space will move the cursor to the right, jumping the character. This is very useful and already well known.</p> <p>Now I was thinking that would be nice to have the inverse too. Imagine that I just jumped a closing } but then I remember that I still had something to type inside the {}. It would be great to be able to do shift+space again and get back inside the {}.</p> <p>I was checking <a href="http://sublimetext.info/docs/en/reference/key_bindings.html" rel="nofollow">this documentation</a> but everything I tried didn't worked.</p> <p>Any help or ideas on this? Tks!</p> <p><strong>EDIT : BASED ON CORRECT ANSWER:</strong></p> <p>So, based on @skuroda's answer, this is what I came up with. For more information, read the comments below his answer.</p> <pre><code>{ "keys": ["shift+space"], "command": "move", "args": {"by": "characters", "forward": false}, "context": [ { "key": "preceding_text", "operator": "regex_contains", "operand": "[)'\"\\}\\]&gt;,\\;:]$", "match_all": true }, { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, { "keys": ["shift+space"], "command": "move", "args": {"by": "characters", "forward": true}, "context": [ { "key": "following_text", "operator": "regex_contains", "operand": "^[)'\"\\}\\]&gt;,\\;:]", "match_all": true }, { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, </code></pre> <p>The order of the code is important (preceding_text command must come before following_text one).</p> <p>UPDATE: I think I found a much simpler and better solution for this:</p> <pre><code>{ "keys": ["shift+space"], "command": "move", "args": {"by": "characters", "forward": true} }, { "keys": ["super+shift+space"], "command": "move", "args": {"by": "characters", "forward": false} } </code></pre> <p>So, the context doesn't really matter here. <code>Shift + Space</code> will advance one character, <code>CMD + Shift + Space</code> will go back one character. Pure joy!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload