Sublime Text 3 Settings: Save Twice

2019-09-09 14:10发布

问题:

I am not sure if this is the correct place to ask this or not, if it's not please let me know where would be the right place.

There is a well known issue with LiveReload for Sublime Text in which the changes are not shown unless you save twice.

I'm wondering if there is a way to edit the settings to have ST automatically save twice when you hit save.

回答1:

You can override the default keybinding to instead save twice. In order to do that you will need a way to call the "save" command more than once. This post tells how to do that. Basically, install the Chain of Command package so that you may call the custom "chain" command, which will run the commands you pass as an array of args. This will allow you to define your new keybinding in your keybindings file.

Default (OSX).sublime-keymap — User

{ "keys": ["super+s"], 
  "command": "chain",   
  "args": {
     "commands": [
       ["save"],
       ["save"]
     ]
  } 
}