Reputation: 1660
Can we have same keyboard shortcuts for different actions in Visual Studio? For example renaming file and renaming class to be whit the same shortcut? Or for example comment and uncomment whit the same shorcut? When I assing shorcut that already exists it is overloaded. I use VS 2015. Thanks in advance.
Upvotes: 1
Views: 949
Reputation: 57922
Yes. Go to Tools > Options > Environment : Keyboard and you can view and change the key bindings.
The same key can be bound to multiple commands in different contexts (global hotkeys, or limited to only work when the input focus is in a particular window)
Just click in the "Press shortcut keys" field and type a hotkey combination. Then drop down the "Shortcut currently used by" combo box to see the list of commands that can be executed by that hotkey, and the contexts in which this will happen. You can then select any of those commands in the list above and Remove the hotkey from any of them if you wish, and/or assign new hotkeys.
However, for obvious reasons, you cannot assign two commands to the same hotkey in the same context - if you try to do this, then the new assignment will simply overwrite the old one.
Upvotes: 1