Adding Custom Menus in Sublime Text

前端 未结 3 1038
广开言路
广开言路 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:30

    I know this way too late to join the party and add my 2 cents. Anyway, Main.sublime-menu is a file that allows you to add menu items to the top menu i.e [File, Edit, Selection, Find, View, Goto, etc.]

    I recently added a new section "Dev" just to figure it out. I also wanted a way to trigger browser previews for a specific browser. Check it out.

      [
        {
        "caption": "Dev",
        "mnemonic": "Z",
        "id": "dev",
        "children": [
          {
            "caption" : "Previews",
            "children": [
              { "caption": "Markdown Live Preview", "command": "new_markdown_live_preview", "id": "markdown_live_preview" },
              { "caption": "Preview in Default Browser", "command": "view_in_browser", "id": "markdown_live_preview" },
              { "caption": "Preview in Firefox", "command": "view_in_browser", "args": { "browser": "firefox" }, "id": "markdown_live_preview" },
              { "caption": "Preview in Chrome","command": "view_in_browser", "args": { "browser": "chrome" }, "id": "markdown_live_preview" },
              { "caption": "Preview in Safari", "command": "view_in_browser", "args": { "browser": "safari" }, "id": "markdown_live_preview" },
              ]
            },
          ]
        }
      ]
    

    Anyway, this still works in ST3. Just in case anyone stumbles around here.

提交回复
热议问题