Sublime Forum

Right click To Build File

#1

It would be very handy do include the Build features that are in the Tools menu into the right click menu. Just a small feature and if people don’t like it, maybe add an option in settings to disable that. Thanks for reading!

0 Likes

#2

Though personally I don’t think right click menu is handier than using existing keybindings. But you definitely can do that by yourself, already.

Create Context.sublime-menu in Packages/User/ with

[
    {
        "caption": "Build System",
        "mnemonic": "u",
        "children":
        [
            { "command": "set_build_system", "args": { "file": "" }, "caption": "Automatic", "checkbox": true },
            { "caption": "-" },
            { "command": "set_build_system", "args": {"index": 0}, "checkbox": true },
            { "command": "set_build_system", "args": {"index": 1}, "checkbox": true },
            { "command": "set_build_system", "args": {"index": 2}, "checkbox": true },
            { "command": "set_build_system", "args": {"index": 3}, "checkbox": true },
            { "command": "set_build_system", "args": {"index": 4}, "checkbox": true },
            { "command": "set_build_system", "args": {"index": 5}, "checkbox": true },
            { "command": "set_build_system", "args": {"index": 6}, "checkbox": true },
            { "command": "set_build_system", "args": {"index": 7}, "checkbox": true },
            { "command": "set_build_system", "args": {"index": 8}, "checkbox": true },
            { "command": "set_build_system", "args": {"index": 9}, "checkbox": true },
            { "command": "set_build_system", "args": {"index": 10}, "checkbox": true },
            { "command": "set_build_system", "args": {"index": 11}, "checkbox": true },
            { "caption": "-" },
            { "command": "$build_systems" },
            { "caption": "-" },
            { "command": "new_build_system", "caption": "New Build System…" }
        ]
    },
    { "command": "build", "mnemonic": "B" },
    { "command": "build", "args": {"select": true}, "caption": "Build With…" },
    { "command": "cancel_build", "caption": "Cancel Build", "mnemonic": "C" },
    {
        "caption": "Build Results",
        "mnemonic": "R",
        "children":
        [
            { "command": "show_panel", "args": {"panel": "output.exec"}, "caption": "Show Build Results", "mnemonic": "S" },
            { "command": "next_result", "mnemonic": "N" },
            { "command": "prev_result", "caption": "Previous Result", "mnemonic": "P" }
        ]
    },
]

Those above are just copied from the Default.sublime-package/Main.sublime-menu.


Learn more from https://www.sublimetext.com/docs/menus.html

3 Likes

#3

Oh shoot I didn’t know you could do that! Thank you!

0 Likes