各种IDE的多行注释快捷键、代码排齐格式化快捷键

546 阅读1分钟

IDE快捷键

多行代码注释快捷键:

  • VS2017 和 VScode:

    ctrl K C ctrl K U 或者: ctrl K ctrl C ctrl K ctrl U

  • eclipse:

    ctrl / 或者 ctrl shift C 或者 shift ctrl / 或者 alt shift J

  • jupyter notebook 和 pycharm:crtl /

  • IntelliJ IDEA:ctrl / 或者 ctrl shift /

  • Xcode: command /

  • matlab

    ctrl R ctrl T

  • RStudio:ctrl shift C

  • texstudio

    ctrl T ctrl U

  • winedt: 选中-右键-Insert-Comment 或者 shift ctrl alt 方向键右键(先按住前三个不放) shift ctrl alt 方向键左键

  • texworks: ctrl shift ] ctrl shift [

  • Codeblocks: Ctrl+Shift+C Ctrl+shift+X

代码排齐快捷键:

  • VS: ctrl+k+d ctrl+k+f

  • VScode:

    • shift+alt+F
    • 安装beautify插件,按ctrl+shift+P, 选择beautify file
    • ctrl+shift+P, 输入format,选择格式化文档
  • Codeblocks:代码区域右击 点“format use AStyle”

  • Xcode: Command + i

  • IntelliJ IDEA:ctrl+alt+L

  • Clion: ctrl+alt+L

动作撤销恢复快捷键:

  • IntelliJ IDEA: ctrl+Z 撤销 ctrl+shift+Z 恢复

统计代码行数

  1. Visual Studio查询代码行数

    Ctrl+Shift+F ^b*[^:b#/]+.$* 使用正则表达式

  2. VScode

    1. 同上:b*[^:b#/]+. *、^b*[^:b#/]+.*
    2. 下载VS Code Counter插件,Ctrl+Shift+P,输入Count lines in workspace,

其他

  • VScode

    • ctrl+\ 分屏
    • ctrl+shift+5 拆分终端
    • ctrl+shift+k or Shift+Delete 删除本行
    • ctrl+Delete 从光标往后删除一个变量or之类的对象
  • Visual Studio

    1. ctrl + D 复制本行并粘贴到下一行
    2. Shift + End 光标到行末的字符被选中
    3. Shift + Home 光标到行首的字符被选中
    4. ctrl + l 删除本行
    5. Ctrl + M + O: 折叠所有方法
    6. Ctrl + M + M: 折叠或者展开当前块
    7. Ctrl + M + L: 展开所有方法
  • Clion、IntelliJ IDEA

    • ctrl+shift+R 全局替换
    • ctrl+x 删除行
    • ctrl+shift+- 代码折叠
    • ctrl+shift++ 代码展开

Thank you very much for your reward !\

\