Easier Way

The easier way and cleaner way is to set the user keybinding instead of mess with the defaults. The user keybindings override the default key binds.

Here I change my console character to ctrl+shift+c (as I used ctrl+` for clcl application)

Open Preferences->Key Bindings-User

[
{ "keys": ["ctrl+s"], "command": "save" },
{ "keys": ["ctrl+shift+x"], "command": "prompt_save_as" },
{ "keys": ["ctrl+shift+s"], "command": "save_all" },
{ "keys": ["ctrl+shift+c"], "command": "show_panel", "args": {"panel": "console", "toggle": true} }
]

 Harder Original Way

By default there is no keybinding for save all, but thats a useful feature to have binded.

Open Preferences->Key Bindings-Default

Find at the top of the file where the saving bindings are that look like this:

{ “keys”: [“ctrl+shift+n”], “command”: “new_window” },
{ “keys”: [“ctrl+shift+w”], “command”: “close_window” },
{ “keys”: [“ctrl+o”], “command”: “prompt_open_file” },
{ “keys”: [“ctrl+shift+t”], “command”: “reopen_last_file” },
{ “keys”: [“alt+o”], “command”: “switch_file”, “args”: {“extensions”: [“cpp”, “cxx”, “cc”, “c”, “hpp”, “hxx”, “h”, “ipp”, “inl”, “m”, “mm”]} },
{ “keys”: [“ctrl+n”], “command”: “new_file” },
{ “keys”: [“ctrl+s”], “command”: “save” },
{ “keys”: [“ctrl+shift+s”], “command”: “prompt_save_as” },
{ “keys”: [“ctrl+f4”], “command”: “close_file” },
{ “keys”: [“ctrl+w”], “command”: “close” },

Just add the save_all key binding below the the promp_save_as key binding. Make sure to change the prompt_save_as to ctrl+shift+x (i checked its not used), make sure to satisfy the indentation (Which I dont show here, as all the text I copy pasted is trimmed  of indentation – note the indentation is just one tab character)

{ “keys”: [“ctrl+shift+n”], “command”: “new_window” },
{ “keys”: [“ctrl+shift+w”], “command”: “close_window” },
{ “keys”: [“ctrl+o”], “command”: “prompt_open_file” },
{ “keys”: [“ctrl+shift+t”], “command”: “reopen_last_file” },
{ “keys”: [“alt+o”], “command”: “switch_file”, “args”: {“extensions”: [“cpp”, “cxx”, “cc”, “c”, “hpp”, “hxx”, “h”, “ipp”, “inl”, “m”, “mm”]} },
{ “keys”: [“ctrl+n”], “command”: “new_file” },
{ “keys”: [“ctrl+s”], “command”: “save” },
{ “keys”: [“ctrl+shift+x”], “command”: “prompt_save_as” },
{ “keys”: [“ctrl+shift+s”], “command”: “save_all” },
{ “keys”: [“ctrl+f4”], “command”: “close_file” },
{ “keys”: [“ctrl+w”], “command”: “close” },

Then save (ctrl+s) the file, and you should see you keybinding when you click on the File Menu.

Leave a Reply

Your email address will not be published. Required fields are marked *