Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime Text 2 sidebar context: Vim-like key bindings for sidebar navigation

Does anyone know the "context" for the Sublime Text 2 side bar, or have any idea how to find the context?

I use Sublime Text 2 in Vintage mode, and along with several custom key bindings (and VintageEx) rarely have to leave the home row. Re-binding 'j', 'k', and the likes without specifying a context carries over to Insert mode in the edit window(s) so that there is movement rather than typing j or k. To be more concrete, any thoughts on what should replace '???' in this mapping:

{ "keys": ["j"], "command": "move", "args": {"by": "lines", "forward": true} , "context": [{"key": "???"}] }

to use 'j' in place of the down arrow in the sidebar?

Many thanks!

like image 290
jacob-ogre Avatar asked Jun 13 '13 02:06

jacob-ogre


1 Answers

Here you go. Just add this to your Preferences->Key Bindings-User.

{ "keys": ["h"], "command": "move", "args": {"by": "characters", "forward": false}, "context":
    [ {"key": "control", "operand": "sidebar_tree"} ]
},
{ "keys": ["j"], "command": "move", "args": {"by": "lines", "forward": true}, "context":
    [ {"key": "control", "operand": "sidebar_tree"} ]
},
{ "keys": ["k"], "command": "move", "args": {"by": "lines", "forward": false}, "context":
    [ {"key": "control", "operand": "sidebar_tree"} ]
},
{ "keys": ["l"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
    [ {"key": "control", "operand": "sidebar_tree"} ]
}

Hope that helps!

like image 112
Dan Williams Avatar answered Oct 05 '22 02:10

Dan Williams