Changing Keyboard Shortcuts

I'm used to other programming editors, so the keyboard shortcuts in Visual Studio kind of annoy me. I was able to successfully change the shortcut for "Find Next" to control-G, but the other shortcuts I'm trying to change don't work.

I'd like to change:

"Increase Indent" to control-]

"Decrease Indent" to control-[

"Comment" to control-=

"Uncomment" to control--

(Those last two are the + and - keys for commenting)

"Decrease Indent" and "Uncomment" seem to work, the other two do not. According to the help files and a page I found here on MSDN, the custom keyboard shortcuts you set *should* over-ride any other keyboard shortcuts in the program-- unfortunately, it looks like "Increase Indent" and "Comment" can't have their shortcuts changed.

Either the documentation is wrong, or this is a bug in the product. Am I missing something I'd really like this to work so I can be productive. Can somebody speak to this Thanks.



Answer this question

Changing Keyboard Shortcuts

  • Orenbutn

    Sorry to reply to myself. The solution worked, but (you recall) I *did* set "Find Next" to control-G which is (by default) set to "Go To Line", and I didn't have to delete the shortcut for "Go To Line" first. So there has to be something else going on here. For some reason, the shortcut "control-G" can exist for two functions but "control-]" can't. Weird! And still looks like a bug to me, one way or another.
  • StephenMas

    have you tried going to tools > options > environment > keyboard and checking the commands there and re-assigning the values

    Just looking at it just now, I went there and typed in the "Show commands containing" field "incre" and filtered up to "Edit.IncreaseLineIndent". I would then suspect that you press the shortcut keys in the correct box and press assign. Same applies for the rest too



  • xavier.oudin

    Hello-

    The shortcut keys that you are trying to bind to the two commands that you say are not working are already bound to some other commands. You can see this when you try to add the shortcut because the commands show up in the "Shortcut currently used by:" field.

    Please try typing in the name of these commands into "Show commands containing:" and clicking "Remove" to erase that key binding from the other command(s). Once your shortcut is only bound to a single command it should work fine for you.

    Hope this helps.

    -Luke



  • 2326ac

    I'm confused. The documentation (as stated above) says that the shortcuts I set override any previous shortcuts. Is this incorrect then Meaning I have to remove any existing shortcuts before setting my own
  • Changing Keyboard Shortcuts