Comment shortcut Android Studio

后端 未结 24 2658
野趣味
野趣味 2020-12-22 19:55

I\'m searching for useful Android Studio keyboard shortcut for commenting code, as in Sublime Text or Eclipse.

When I press either cmd+/ or

相关标签:
24条回答
  • 2020-12-22 19:59

    Reviewing and Changing Keyboard Shortcuts in Android Studio

    Keyboard shortcuts can be configured (and reviewed) via the Settings dialog, accessible via File -> Settings.

    Once this dialog appears, to review (and/or add) a shortcut, do the following:

    1. Select Keymap in the list on the left. Note that there is a "Keymaps" option, and depending on the original selection, shortcuts assigned to a given feature differ based on the Keymap.

    2. Type "comment" or text corresponding to the feature for which the keyboard shortcut is to be reviewed/assigned. Each match has a line entry in the list below, and keyboard shortcuts are shown right-justified along with the feature. For example, both CTRL+ALT+SLASH and CTRL+K, CTRL+C are the two assignments for creating a line comment.

    To modify a shortcut:

    1. Select the resultant line corresponding to the feature for which the keyboard shortcut is to be reviewed/assigned
    2. Right-click, and select the desired Add or Remove option.
    0 讨论(0)
  • 2020-12-22 19:59

    In Android studio CTRL + SHIFT + / for windows.

    0 讨论(0)
  • 2020-12-22 19:59

    In LINUX

    1.Single line commenting. Ctrl + /

    2.For block comment Ctrl + Shift + /

    0 讨论(0)
  • 2020-12-22 20:05

    Ctrl + Shift + / works well for me on Windows.

    0 讨论(0)
  • 2020-12-22 20:06

    Mac With Numeric pad

    Line Comment hold both: Cmd + /

    Block Comment hold all three: Cmd + Alt + /

    Mac

    Line Comment hold both: Cmd + + =

    Block Comment hold all three: Cmd + Alt + + =


    Windows/linux :

    Line Comment hold both: Ctrl + /

    Block Comment hold all three: Ctrl + Shift + /

    Same way to remove the comment block.


    To Provide Method Documentation comment type /** and press Enter just above the method name (

    It will create a block comment with parameter list and return type like this

    /**
     * @param userId 
     * @return
     */
    public int getSubPlayerCountForUser(String userId){}
    
    0 讨论(0)
  • 2020-12-22 20:08

    on mac, using uk english keyboard layout to reach quickcomment in android studio the key combination is:

    cmd + alt(option) + /

    0 讨论(0)
提交回复
热议问题