简体   繁体   中英

let sublimetext run last used build command

As an example, there are two files, main.py and module.py , I could only run the project when main.py is in the current active tab window by Ctrl + B . However, a big amount of my code work is in module.py , after some modification of module.py , I have to switch to main.py to run and test my code, frequently switching to main.py is not convenient, I wonder if there is a way to run module.py when the current file in the active tab window is module.py rather than main.py .

Briefly, I have main.py and module.py opened in Sublime, after running main.py I switch to module.py , how to run main.py when the current file in the active tab window is module.py rather than main.py ?

I found a solution in this post , but that requires to configure manually, I expect there is a feature to remember last build command so that I can repeat last command by some shortcut. It would be welcome if someone can guide me to write some plugin to implement the feature.

The solution in the article you linked to (creating a custom build system that always runs main.py regardless of which file is focused) is the recommended solution. There is no built-in way to rerun the last build using the same file.

Sure, you could go through the time and effort to write a plugin, but why? The solution is right in front of you, and only requires you to put a couple of lines of JSON in your .sublime-project file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM