Adding Custom Menus in Sublime Text

前端 未结 3 1039
广开言路
广开言路 2021-02-04 07:50

How to add a custom Menu item in SublimeText 2 .

Any Ideas ??
I see there is a Main.sublime-menu file but dont know how to edit i

3条回答
  •  一整个雨季
    2021-02-04 08:46

    Easier option if what you want is just run a command. Create a file Context.sublime-menu inside your Packages/User directory, and add the following:

    [
        { "caption": "", "command": "exec", "args": {"cmd": ["", "", "", <...>]} }
    ]
    

    Exemple: Adding a menu item to the context menu that just run dir:

    [
       { "caption": "List files in current dir", "command": "exec", "args": {"cmd": ["dir"]} }
    ]
    

提交回复
热议问题