How to use sidebar with the keyboard in Sublime Text 2 and 3?

前端 未结 13 1440
我寻月下人不归
我寻月下人不归 2021-01-29 17:57

When using Sublime Text 2 we tend to open the side bar to navigate thru files/folders in our projects. For that we can use the hotkey ctrl+k ctrl+b (i

13条回答
  •  野性不改
    2021-01-29 18:31

    Summary

    Ctrl + 0 will navigate to your sidebar. By default you can navigate the folders with your arrow keys. If you prefer 'Vim' type settings, you can avoid using the arrow keys by remapping your keys to the typical Vim settings (hjkl).

    • h will minimize/open a folder
    • j will navigate down (i.e. down arrow)
    • k will navigate up (i.e. up arrow)
    • l will open up a folder
    • Enter will open the file

    Key mappings

    To set this up, open Preferences > Key Bindings - User and add the following:

    { "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"} ] }
    

提交回复
热议问题