I want to know how to configure two commands for one shortcut in SublimeText3.

Asked 2 years ago, Updated 2 years ago, 135 views

In SublimeText3, if you press ctrl+a, I would like to register Save All + Reload Chrome Active Tab as a shortcut. Do you know how to run two commands with a shortcut?

·Shortcut you want to register
ctrl+a

·The command you want to register
save_all and browser_refresh

補足 Supplemental
browser_refresh is one of the SublimeText 3 plug-ins, and pressing ctrl+shift+r will "overwrite/save the active file on SublimeText3" and "reload the active tab of Chrome"

For example, if you open HTML and CSS files one at a time and the CSS file is active, pressing ctrl+shift+r will overwrite and save only the CSS file and reload the Chrome active tab.

However, since I often edit HTML and CSS at the same time, the operation "Save Active Tabs" does not save changes to inactive files and does not reflect changes, so I have to select Save All and do two actions: ctrl+shift+r, which is inconvenient.

-------------------

The explanation is a little longer, but if you press a specific key, you can save everything + reload Chrome's active tab by any means.

sublimetext

2022-09-30 14:50

1 Answers

It may have already been resolved considering the time of your question, but I would like to comment on it.

There are probably three approaches to meeting your needs.

  • a) Register a macro that executes multiple commands of interest and register a key binding that invokes the macro with the run_macro_file command
  • b) Install and utilize the Chain of Command package
  • <li>c) Create your own package and create commands to execute multiple commands.Then register the key bindings to execute the command

It's essentially the same for all approaches, so I think you should choose the method you like.

Below is a reference link.

I hope it will be helpful.


2022-09-30 14:50

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.