How to Assign Visual Studio Shortcut for GhostDoc

Sometimes you may reset default GhostDoc shortcut in Visual Studio or want to assign your own custom shortcut.

Here is how you do that:


  1. In Visual Studio go to Tools -> Options, then select Environment -> Keyboard 
  2. Filter commands by "GhostDoc" in the Show commands containing text box
  3. Select Tools.SubMain.GhostDoc.DocumentThis in the list
  4. Select "Text Editor" in the Use new shortcut in drop down
  5. Choose the hotkey you want to invoke the DocumentThis command (Ctrl+Shift+D in this example)
  6. Press Assign and OK to close the dialog and save. You are all set.

While you are in the Options dialog you may want also assign shortcut to another less known but very useful GhostDoc command Rebuild Documentation. This command will rebuild your existing XML comment using the changed signature information. Be careful with this command though - it will reset your custom edited XML comment. In the example below we assigned command RebuildDocumentation to sequence Ctrl+Shift+D, Ctrl+Shift+R