IDEA学习

IDEA说明:
  1. jetbrains公司出品。
    旗下:webStorm:开发JS/HTML5/CSS3前端。
    CLion:开发C/C++
    DataGrip:开发数据库和SQL
    AppCode:开发MAC/苹果手机ios 替换XCode
    rubyMine:开发ruby/rails
    Rider:开发.net
    GoLand:开发Go。区块链
    pyCharm:python语言。开发大数据,人工智能,数据分析,数据挖掘。

  2. Android Studio:谷歌开发基于IDEA社区版迭代。

  3. 特点:智能代码助手,代码自动提示,重构,j2ee支持,ant,junit,maven,cvs,代码审查,创新GUI设计。

  4. 对jave,scala(大数据底层) and Groovy使用java类库,使用java虚拟机
    与eclipse优势:

  5. 强大的整合能力:比如:git,maven,sping等版本控制工具

  6. 提示功能快速、便捷

  7. 提示功能范围广对:jsp/js

  8. 好用的快捷键和代码模板(固定代码块)

  9. 搜索精准。

常用设置

A. idea 的toolbar/toolbuttons开启:view-appearance
ctrl+s在eclipse,idea实时保存

  1. 主题:setting-appearance&behaver-appearance-UI Option-Them

  2. maven配置:setting-build、Execution、Deployment-build Tools-Maven(Maven home directory/User settings file/Local repository)

  3. 编辑区主题:setting-Editor-color Scheme

  4. ctrl+滚轮放大缩小字体:setting-Editor-General—Change font size (zoom) with Ctrl+Mouse Wheel勾选

  5. 鼠标悬浮提示:setting-editor-code editing-show quick document on mouse move.

  6. 自动倒包:setting-editor-General—Auto import-java-all
    手工倒包eclipse:ctrl+shift+O idea:alt+enter

  7. 设置行号、方法间分隔符:setting-editor-General—appearance-show line numbers/show method separtors

  8. 写代码忽略大小写,都提示:setting-editor-General—cdoe completetion-去掉math case的?。

  9. 取消单行显示tabs操作,所有打开的的页签多行显示:setting-editor-General-Editor tabs-去掉show tabs in single row的?。

  10. 整体字体:editor-font

  11. 编辑框字体:editor-color Scheme-color Scheme font

  12. 控制台字体:editor-color Scheme-cosole Scheme

  13. 注释颜色:editor-color Scheme-language Defaults-comments-line comment/block comment(多行)

  14. 倒包,同包个数超过指定个数,改为*:editor-code style-java-imports

  15. 修改类头文档信息:editor-file and code templates-file header

  16. 项目文件编码:editor-file encodings-project encodings/default encoding for properties files:utf-8右侧也? transparent native-to-ascii conversion
    import file乱码时:控制台右下角utf-8 reload(utf以gbk显示)、convert转换

  17. 设置自动编译:build/execution/deployment-compiler-build project automatically/compile independent modules in parallel的?。
    eclipse:projcet-build automatically

  18. 省电模式:file -power save mode关闭代码检查、提示功能

  19. 代码页签右键-split horizontally(水平)、split vertically(垂直)

  20. idea自动加载HTML和JS页面设置:

    • Ctrl + Alt + S打开设置面板,build-compiler—勾选 Build project automatically选项

    • Ctrl + Shift + A查找registry命令: 在查找到的registry命令通过鼠标双击或敲回车键,在弹出的面板中找到并勾选compiler.automake.allow.when.app.running选项

    • spring boot 热部署下面的running Application Update Policies这两个要设置
      在这里插入图片描述

  21. 若遇到 @Autowired 标记的变量出现 红色下划线,但是不影响 正常运行。可以进入 Settings,找到 Editor—Inspection,并选择其中的 Spring Core -> Code -> Autowiring for Bean Class,将 Error 改为 Warning,即可。

  22. Idea 控制台不显示Services窗口

  • 首先选择 Run - Edit configurations
  • 然后选择Templates 在Configurations available in Services 下添加configuration types,点击+号选择添加Spring boot
代码模板
  1. editor-live Templates 可以定制(修改删除增加)
    (iteration遍历,other条件判断,plain常量)
  2. editor-General-Postfix Completion (使用现成的)同样的设置快一点(java)

常用的模板:

  1. main方法:eclipse main; idea:psvm+Tab
  2. System.out:eclipse sysout; idea:sout+Tab
    变形(soutp(方法参数)/soutm(方法)/soutv(就近变量))/变量.sout/变量.soutv
  3. for loop: fori(普通)
    变形:增强 iter 、itar(普通)
  4. List.for)(增强): (普通)list.fori正序 list.forr逆序(普通)
  5. if:
    ifn :if(xxxnull)
    inn :if(xxx!=null)
    xxx.nn :if(xxx!=null)
    xxx.null :if(xxx
    null)
  6. prsf:生成private static final
    psf:生成public static final
快捷键设置

菜单栏:File-setting-keymap
下拉框选成eclipse

  1. 运行(run):Ctrl+Shift+F10
  2. 提示补全(class name completion):alt+/
  3. 单行注释:ctrl+/
  4. 多行注释:ctr+Shift+/
  5. 向下复制一行(Duplicate lines):ctr+alt+MumPad 2
  6. 向下移动一行(move statement down):alt+方向下键
  7. 向上移动一行(move statement up):alt+方向上键
  8. 向下开始新一行(start new line):Shift+enter
  9. 向上开始新一行(start new line before current):ctr+alt+enter
  10. 查看源码(class):ctrl+左单击和ctrl+Shift+T
  11. 万能解错/生成变量返回值:alt+enter == eclipse:ctrl+1
  12. 返回前一个编辑页面(back):alt+left
  13. 返回后一个编辑页面(forward):alt+right
  14. 查看继承结构(type hierarchy):F4
  15. 格式化代码(reformat code):ctrl+Shift+F
  16. 查看类结构:ctrl+O == eclipse:outline
  17. 大小写转换(toggle case):ctrl+Shift+y /ctrl+Shift+u
  18. 重构(rename):alt+Shift+r
  19. 生成构造器/get/set/toString:alt+MumPad 3
  20. 查看文档说明(quick documentation):F2
  21. 提示方法参数类型(parameter info): ctrl+alt+/
  22. 收起所有方法(collapse all): ctrl+Shift+MumPad /
  23. 打开所有方法(expand all) :ctrl+MumPad * ; 单个关闭ctrl+MumPad + 单个打开ctrl+MumPad -
  24. 打开代码所在硬盘文件(show in explorer):ctrl+Shift+x
  25. 生成try-catch等(surround with):alt++Shift+Z
  26. 局部变量抽取位成员变量(introduce field):
  27. 查找/替换当前:ctrl +f
  28. 查找(全局):ctrl+h
  29. 查找文件:double Shift
  30. 查看类继承结构图(show UML Diagram):ctrl+alt+Shift+U
  31. 查看方法的多层重写结构(method hierarchy):ctrl+Shift+H
  32. 添加到收藏(add to favorites):alt+Shift+L
  33. 抽取方法(extract method):alt+Shift+M
  34. 打开最近修改的文件(Recetly Files) Ctrl+E
  35. System.out.println(“”): sout+Tab
  36. 关闭当前打开的代码栏(close) Ctrl+F4
  37. 关闭打开所有的代码栏(close all):ctrl+Shift+W
  38. 快速搜索类中的错误(next highlighted error):ctrl+Shift+Q
  39. 选择要粘贴的内容(show in explorer):ctrl+Shift+v
  40. 查找方法在哪里调用(call Hierarchy):ctrl+alt+h
  41. 于定位到某一行:ctrl + L
  42. 重启Idea:ctrl+MumPad 5
  43. 鼠标焦点前进后还原位置:back ALT+< forward ALT+>
  44. CLASSPATH:%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar
插件库

IDEA插件库

下一篇:idea常用快捷键设置
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值