+ Start a Discussion

What is the keyboard shortcut for commenting code in developer console?

Hello Friends,
I have this  below code.
<apex:page standardController="Account">
    {! Account.Name }
    {! Account.Phone}
I can comment the code by standard way (" <!-- This is commented part --> ") which I can do with few clicks.

Is there a way using the keyboard shortcut to do so? MS Visual Studio has it. May be the Eclipse too, although not sure.

Please help, thanks!
Currently there is no keyboard shortcuts to comment the code. Following are the keyboard shortcuts aviable for developer console
  • Open CTRL+O
  • Open Lightning Resources CTRL+SHIFT+A
  • Open log CTRL+G
  • Open raw log CTRL+SHIFT+G
  • Download log CTRL+ALT+G
  • Save the current view CTRL+S
  • Save all CTRL+SHIFT+S
  • Delete CTRL+DELETE
  • Close CTRL+/
  • Close all CTRL+ALT+/
  • Open the Execute Anonymous window CTRL+E
  • Execute anonymous Apex code when the Execute Anonymous window is open or the last executed code when the window is closed CTRL+ALT+E
  • View log panels... CTRL+P
  • Log panel SHIFT+ALT+G
  • Show/Hide help for the shortcut key CTRL+SHIFT+?
  • Find CTRL+F
  • Find/replace CTRL+SHIFT+F
  • Find/replace all CTRL+SHIFT+R
  • Search in files CTRL+SHIFT+H
  • Fix indentation SHIFT+TAB
  • Open resource CTRL+SHIFT+O
  • Clear log panel SHIFT+ALT+G
  • Show Preview of the Visualforce page/component CTRL+J
  • Navigate to the declaration of a selected object in the Source Code Editor CTRL+ALT+N
  • Show/Hide the Command Line Console CTRL+SHIFT+L
  • Navigate backward through the view history CTRL+,
  • Navigate forward through the view history CTRL+.
  • Navigate backward through the open views CTRL+PAGE UP
  • Navigate forward through the open views CTRL+PAGE DOWN
  • Toggle full screen editing of the current view, if available F11
  • Exit full screen editing of the current view, if active ESC
I came with the same conclution.

Hence had to post an idea at - https://success.salesforce.com/ideaView?id=08730000000DqmhAAC
Saurabh Sood 8Saurabh Sood 8

Hi sfdcviraj,
It's better to use sublime editor for more flexibility and write code in offline also without getting error.
Austin Wang 13Austin Wang 13
Use Sublime + mavenmate or simply copy to sublime editor then copy it back to console. 
In Sublime, the shortkey is Ctrl + /
Hi sfdcviraj,

   we are able to create custom Shortcut as per your daily requirement.there are some explanation about this I hope it is useful for You
   1)Creating a Custom Shortcut  – The Logout of salesforce.com Hotkey

     One of the simplest keyboard shortcuts is logging out of Salesforce. Let's set it up.

     a)Defining the Keyboard Shortcut

  a)First, go to the Keyboard Shortcuts setup page for your Console and via Setup-> Create-> Apps-> Your Console -> "Customize keyboard shortcuts"-> Edit.
               b)Now add a new shortcut. "Click Add Keyboard Shortcut"

               c)Fill out the shortcut details. Note that the name of the shortcut event is namespaced with "custom shortcut". This is good practice and avoids possible conflicts with existing or future events in the Console.

               d)Now we save and move on to the next step.

Since we want the shortcut to be available at all times, the listener must also be available at all times in the Console.

Some Standard Shortcut Key is also in console check it on a link:


If you found this answer helpful then please mark it as best answer so it can help others.