Intellij IDEA 快捷键


 一、常规

  1. alt + 7 ,可以查看类的字段、属性、方法,是否继承等
  2.  ctrl + F12,可以查看类的字段、属性、方法,是否继承等


  1. Ctrl+Shift + Enter,语句完成
  2. “!”,否定完成,输入表达式时按 “!”键
  3. Ctrl+E,最近的文件
  4. Ctrl+Shift+E,最近更改的文件
  5. Shift+Click,可以关闭文件
  6. Ctrl+[ OR ],可以跑到大括号的开头与结尾
  7. Ctrl+F12,可以显示当前文件的结构
  8. Ctrl+F7,可以查询当前元素在当前文件中的引用,然后按 F3 可以选择
  9. Ctrl+N,可以快速打开类
  10. Ctrl+Shift+N,可以快速打开文件
  11. Alt+Q,可以看到当前方法的声明
  12. Ctrl+P,可以显示参数信息
  13. Ctrl+Shift+Insert,可以选择剪贴板内容并插入
  14. Alt+Insert,可以生成构造器/Getter/Setter等
  15. Ctrl+Alt+V,可以引入变量。例如:new String();  自动导入变量定义
  16. Ctrl+Alt+T,可以把代码包在一个块内,例如:try/catch
  17. Ctrl+Enter,导入包,自动修正
  18. Ctrl+Alt+L,格式化代码
  19. Ctrl+Alt+I,将选中的代码进行自动缩进编排,这个功能在编辑 JSP 文件时也可以工作
  20. Ctrl+Alt+O,优化导入的类和包
  21. Ctrl+R,替换文本
  22. Ctrl+F,查找文本
  23. Ctrl+Shift+Space,自动补全代码
  24. Ctrl+空格,代码提示(与系统输入法快捷键冲突)
  25. Ctrl+Shift+Alt+N,查找类中的方法或变量
  26. Alt+Shift+C,最近的更改
  27. Alt+Shift+Up/Down,上/下移一行
  28. Shift+F6,重构 - 重命名
  29. Ctrl+X,删除行
  30. Ctrl+D,复制行
  31. Ctrl+/或Ctrl+Shift+/,注释(//或者/**/)
  32. Ctrl+J,自动代码(例如:serr)
  33. Ctrl+Alt+J,用动态模板环绕
  34. Ctrl+H,显示类结构图(类的继承层次)
  35. Ctrl+Q,显示注释文档
  36. Alt+F1,查找代码所在位置
  37. Alt+1,快速打开或隐藏工程面板
  38. Ctrl+Alt+left/right,返回至上次浏览的位置
  39. Alt+left/right,切换代码视图
  40. Alt+Up/Down,在方法间快速移动定位
  41. Ctrl+Shift+Up/Down,向上/下移动语句
  42. F2 或 Shift+F2,高亮错误或警告快速定位
  43. Tab,代码标签输入完成后,按 Tab,生成代码
  44. Ctrl+Shift+F7,高亮显示所有该文本,按 Esc 高亮消失
  45. Alt+F3,逐个往下查找相同文本,并高亮显示
  46. Ctrl+Up/Down,光标中转到第一行或最后一行下
  47. Ctrl+B/Ctrl+Click,快速打开光标处的类或方法(跳转到定义处)
  48. Ctrl+Alt+B,跳转到方法实现处
  49. Ctrl+Shift+Backspace,跳转到上次编辑的地方
  50. Ctrl+O,重写方法
  51. Ctrl+Alt+Space,类名自动完成
  52. Ctrl+Alt+Up/Down,快速跳转搜索结果
  53. Ctrl+Shift+J,整合两行
  54. Alt+F8,计算变量值
  55. Ctrl+Shift+V,可以将最近使用的剪贴板内容选择插入到文本
  56. Ctrl+Alt+Shift+V,简单粘贴
  57. Shift+Esc,不仅可以把焦点移到编辑器上,而且还可以隐藏当前(或最后活动的)工具窗口
  58. F12,把焦点从编辑器移到最近使用的工具窗口
  59. Shift+F1,要打开编辑器光标字符处使用的类或者方法 Java 文档的浏览器
  60. Ctrl+W,可以选择单词继而语句继而行继而函数
  61. Ctrl+Shift+W,取消选择光标所在词
  62. Alt+F7,查找整个工程中使用地某一个类、方法或者变量的位置
  63. Ctrl+I,实现方法
  64. Ctrl+Shift+U,大小写转化
  65. Ctrl+Y,删除当前行
  66. Shift+Enter,向下插入新行
  67. psvm/sout,main/System.out.println(); Ctrl+J,查看更多
  68. Ctrl+Shift+F,全局查找
  69. Ctrl+F,查找/Shift+F3,向上查找/F3,向下查找
  70. Ctrl+Shift+S,高级搜索
  71. Ctrl+U,转到父类
  72. Ctrl+Alt+S,打开设置对话框
  73. Alt+Shift+Inert,开启/关闭列选择模式
  74. Ctrl+Alt+Shift+S,打开当前项目/模块属性
  75. Ctrl+G,定位行
  76. Alt+Home,跳转到导航栏
  77. Ctrl+Enter,上插一行
  78. Ctrl+Backspace,按单词删除
  79. Ctrl+"+/-",当前方法展开、折叠
  80. Ctrl+Shift+"+/-",全部展开、折叠

 


二、调试部分、编译

  1. Ctrl+F2,停止
  2. Alt+Shift+F9,选择 Debug
  3. Alt+Shift+F10,选择 Run
  4. Ctrl+Shift+F9,编译
  5. Ctrl+Shift+F10,运行
  6. Ctrl+Shift+F8,查看断点
  7. F8,步过
  8. F7,步入
  9. Shift+F7,智能步入
  10. Shift+F8,步出
  11. Alt+Shift+F8,强制步过
  12. Alt+Shift+F7,强制步入
  13. Alt+F9,运行至光标处
  14. Ctrl+Alt+F9,强制运行至光标处
  15. F9,恢复程序
  16. Alt+F10,定位到断点
  17. Ctrl+F8,切换行断点
  18. Ctrl+F9,生成项目(从新编译)
  19. Alt+1,项目
  20. Alt+2,收藏
  21. Alt+6,TODO
  22. Alt+7,结构
  23. Ctrl+Shift+C,复制路径
  24. Ctrl+Alt+Shift+C,复制引用,必须选择类名
  25. Ctrl+Alt+Y,同步
  26. Ctrl+~,快速切换方案(界面外观、代码风格、快捷键映射等菜单)
  27. Shift+F12,还原默认布局
  28. Ctrl+Shift+F12,隐藏/恢复所有窗口
  29. Ctrl+F4,关闭
  30. Ctrl+Shift+F4,关闭活动选项卡
  31. Ctrl+Tab,转到下一个拆分器
  32. Ctrl+Shift+Tab,转到上一个拆分器

三、重构

  1. Ctrl+Alt+Shift+T,弹出重构菜单
  2. Shift+F6,重命名
  3. F6,移动
  4. F5,复制
  5. Alt+Delete,安全删除
  6. Ctrl+Alt+N,内联

四、查找

 

  1. Ctrl+F,查找
  2. Ctrl+R,替换
  3. F3,查找下一个
  4. Shift+F3,查找上一个
  5. Ctrl+Shift+F,在路径中查找
  6. Ctrl+Shift+R,在路径中替换
  7. Ctrl+Shift+S,搜索结构
  8. Ctrl+Shift+M,替换结构
  9. Alt+F7,查找用法
  10. Ctrl+Alt+F7,显示用法
  11. Ctrl+F7,在文件中查找用法
  12. Ctrl+Shift+F7,在文件中高亮显示用法
  13. Ctrl+Shift+Alt+N 查找类
  14. Ctrl+F12,展示类下的所有方法和属性
  15. 快速查找类或方法在整个项目中的位置,按住Ctrl键再点击类或方法会出现所有用到过的文件对象 
  16. 查看类的继承结构,Ctrl+H(Navigate -> Type Hierarchy)
  17. 看接口的实现关系crtl + alt + B    会显示出跟这个接口有关系的类。

 


五、VCS

  1. Alt+~,VCS 操作菜单
  2. Ctrl+K,提交更改
  3. Ctrl+T,更新项目

Ctrl+Alt+Shift+D,显示变化


设置控制台自动换行 

调出problem窗口

 File => Settings => Build, Execution, Deployment => Compiler => 勾选Make project automatically 

 

出现问题Problems窗口会报错


intelliJ IDEA自动优化导入包

Settings→Editor→General→Auto Import 

  1. Optimize imports on the fly   自动去掉一些没有用到的包 
  2. Add unambiguous imports on the fly  自动帮我们优化导入的包

Properties文件乱码

查看的时候显示的是中文,程序运行读取的时候会给我们转换成 ascii 编码


Idea 设置显示当前方法参数提示 

依次打开,Setting>Editor>General>Appearance,找到Show parameter name hints即可

 Appearance 外观

效果 

 


@Autowired注入问题

在IDEA升级2017版后,以前使用的 @Autowired 出现了个警告 Field injection is not recommended


 

https://blog.csdn.net/zhangjingao/article/details/81094529

 


忽略隐藏文件、文件夹


Linux 远程管理工具

 

控制台显示

Tools -> Start SSH session...

 


 

 

Usage of API documented as @since 1.8+ less... (Ctrl+F1) 
Inspection info: This inspection finds all usages of methods that have @since tag in their documentation.  This may be useful when development is performed under newer SDK version as the target platform for production. 

Maven项目每个Module都有单独的pom.xml,如果不在pom.xml中进行配置,则默认将Module的Language Level设置为5。所以要在pom.xml文件中添加插件进行配置。

Compiler插件编译时和编译后运行的JVM版本目前默认的设置为1.5,默认用此版本,而不是根据你项目中指定的jdk版本编译。如果你想改变这些默认设置,你应该设置编译源和目标中java编译器的目标,通过设置Java源代码兼容的JVM版本,标明Java源代码开发过程中使用的Java版本,通过设置编译后的类库拟运行的JVM版本,给出编译后的类库将要运行的Java环境

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.6.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
</build>

 JetBrains

JetBrains是一家捷克的软件开发公司,该公司位于捷克的布拉格,并在俄罗斯的圣彼得堡及美国麻州波士顿都设有办公室,该公司最为人所熟知的产品是Java编程语言开发撰写时所用的集成开发环境:IntelliJ IDEA

设置软件安装的位置

C:\Users\yuanyu\AppData\Local\JetBrains\Toolbox\.settings.json

 install_location 指定安装的位置,记得路径是 \\

"install_location" : "D:\\programmingSoftware\\JetBrains"
{
    "install_location" : "D:\\programmingSoftware\\JetBrains",
	"jetbrains_account": {
    },
    "privacy_policy": {
        "eua_accepted_version": "1.2"
    },
    "shell_scripts": {
        "enabled": false
    },
    "update": {
        "filter": {
            "quality_filter": {
                "order_value": 10000
            }
        }
    }
}

springboot在idea的RunDashboard显示出来

<component name="RunDashboard">
    <option name="configurationTypes">
        <set>
            <option value="SpringBootApplicationConfigurationType" />
        </set>
    </option>
</component>

 https://jingyan.baidu.com/article/ce4366495a1df73773afd3d3.html


Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezone' property manually.

jdbc:mysql://localhost:3306/dbName?characterEncoding=utf-8&serverTimezone = UTC

 

时区错误,MySQL默认的时区是UTC时区,比北京时间晚8个小时。

在mysql的命令模式下,输入

set global time_zone='+8:00';


Error:Cannot build artifact '02.spring-security:war exploded' because it is included into a circular dependency (artifact '02.spring-security:war exploded', artifact '02.springsecurity:war exploded') 

 报个这个错的意思,你大概在编译项目的时候,你构建项目的时候,你点的是build project;而不是选择rebuild project,导致重复的依赖。

这时候找到项目目录中的.idea目录,在进入artifacts文件目录,发现里面有两个重复的文件,删除即可解决错误。


修改、自定义模板

 


@Test
public void test_$VAR1$(){
    $VAR2$
}

/**
* $VAR1$
*/
private String $VAR2$;
$END$

文档注释

This is a built-in template used each time you create a new Java class, by selecting New | Java Class | Class from the popup menu in one of the project views. The template is editable. Along with Java expressions and comments, you can also use predefined variables (listed below) that will then be expanded like macros into the corresponding values. It is also possible to specify an arbitrary number of custom variables in the format ${<VARIABLE_NAME>}. In this case, before the new file is created, you will be prompted with a dialog where you can define particular values for all custom variables. Using the #parse directive, you can include templates from the Includes tab, by specifying the full name of the desired template as a parameter in quotation marks. For example: #parse("File Header.java") 
Predefined variables will take the following values:
${PACKAGE_NAME}			name of the package in which the new class is created
${NAME}					name of the new class specified by you in the Create New Class dialog
${USER}					current user system login name
${DATE}					current system date
${TIME}					current system time
${YEAR}					current year
${MONTH}				current month
${MONTH_NAME_SHORT}		first 3 letters of the current month name. Example: Jan, Feb, etc.
${MONTH_NAME_FULL}		full name of the current month. Example: January, February, etc.
${DAY}					current day of the month
${HOUR}					current hour
${MINUTE}				current minute
${PROJECT_NAME}			the name of the current project

 

 

/**
 * @Author yuanYu
 * @Email 1750762853@qq.com
 * @Date ${YEAR}年${MONTH}月${DAY}日 ${HOUR}:${MINUTE}
 */
This is a built-in template. It contains a code fragment that can be included into file templates (Templates tab) with the help of the #parse directive. The template is editable. Along with static text, code and comments, you can also use predefined variables that will then be expanded like macros into the corresponding values. 
Predefined variables will take the following values:
${PACKAGE_NAME}name of the package in which the new file is created
${USER}			current user system login name
${DATE}			current system date
${TIME}			current system time
${YEAR}			current year
${MONTH}				current month
${MONTH_NAME_SHORT}		first 3 letters of the current month name. Example: Jan, Feb, etc.
${MONTH_NAME_FULL}		full name of the current month. Example: January, February, etc.
${DAY}current day 		of the month
${DAY_NAME_SHORT}			first 3 letters of the current day name. Example: Mon, Tue, etc.
${DAY_NAME_FULL}			full name of the current day. Example: Monday, Tuesday, etc.
${HOUR}						current hour
${MINUTE}					current minute
${PROJECT_NAME}				the name of the current project
DATE         TIME    YEAR    MONTH   MONTH_NAME_SHORT     MONTH_NAME_FULL    DAY     DAY_NAME_SHORT     DAY_NAME_FULL    HOUR    MINUTE
2019/9/19    22:13   2019    09      9月                  九月                19       周四               星期四             22      13

修改运行内存 


Idea assert 未生效

 


IntelliJ IDEA 使用教程:http://wiki.jikexueyuan.com/project/intellij-idea-tutorial/ 

十大Intellij IDEA快捷键:https://blog.csdn.net/dc_726/article/details/42784275

使用IntelliJ IDEA查看类的继承关系图形:   https://blog.csdn.net/u012768459/article/details/79409405

IDEA查看接口或类的继承实现关系图:  https://blog.csdn.net/jae_wang/article/details/80058541

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值