Sublime Text 3 Settings: Save Twice

2019-09-09 14:27发布

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条回答
虎瘦雄心在
2楼-- · 2019-09-09 14:58

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"]
     ]
  } 
}
查看更多
登录 后发表回答