Home >Development Tools >sublime >Use ChainOfCommand package to implement Sublime Text single shortcut key to execute multiple commands

Use ChainOfCommand package to implement Sublime Text single shortcut key to execute multiple commands

藏色散人
藏色散人forward
2019-11-01 11:51:573513browse

The following tutorial column from sublime will introduce how to use the ChainOfCommand package to implement Sublime Text with a single shortcut key to execute multiple commands.

Use ChainOfCommand package to implement Sublime Text single shortcut key to execute multiple commands

sublimeREPL is a good package for constructing Python IDE on Sublime Text.

After configuring the corresponding environment, use the online tutorial to use F5 as the shortcut key for one-click compilation:

[ 
    {
        "keys":["f5"],
        "caption": "SublimeREPL: Python - RUN current file",
        "command": "run_existing_window_command", "args":
        {
            "id": "repl_python_run",
            "file": "config/Python/Main.sublime-menu"
        }
    }
]

The disadvantage of this method is that it must be modified every time after modifying the code. Press Ctrl S to save, and then press F5 to compile the latest version of the file.

The Chain Of Command package perfectly solves this problem.

After installing the package through Package Control, modify the User Setting as follows to realize the function of pressing F5 to save and then compile.

{
        "keys":["f5"],
        "caption":"SublimeREPL: save & Python - RUN current file",
        "command":"chain",
        "args":
        {
            "commands":[
                ["save"],
                [ "run_existing_window_command",{"id": "repl_python_run","file": "config/Python/Main.sublime-menu"}]
            ]
        }
    }

The above is the detailed content of Use ChainOfCommand package to implement Sublime Text single shortcut key to execute multiple commands. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete