IntelliJ常用快捷键及配置

IntelliJ常用快捷键及配置

目录:

1、常用快捷键:

2、常用配置:

 

1、常用快捷键:

(1)psvm:创建main函数

(2)fori:for (int i = 0; i < ; i++) {}

(3)sout:System.out.println()

(4)ctrl + n:查找类

(5)ctrl + shift + n:查找文件

(6)ctrl + alt + l:格式化代码

(7)ctrl + alt + o:格式化import列表,删除掉已导入但未使用的包

(8)ctrl + x:剪切当前行,光标在行的任意位置

(9)ctrl + d:复制当前行,并粘贴到下一行

(10)ctrl + /:注释或取消注释//

(11)ctrl + shift + /:选中要注释或取消注释的区域后使用/* */

(12)ctrl + p:方法参数提示

(13)ctrl + alt + space:类名或接口名提示

(14)shift + F2:鼠标光标移动到有错误代码的位置

(15)ctrl + shift + enter:自动补全末尾的字符

(16)shift + F6:改名,类名,变量名,包名,方法名等等

(17)ctrl + j:查看所有模板

 

图1.1 截图1

(18)ctrl + w:自动按语法选中代码

 

图1.2 截图2

(19)ctrl + shift + w:自动反向选中代码

(20)ctrl + left/right:移动光标到前/后单词

(21)ctrl + y:删除行

(22)shift + shift:可以搜索所有东西,包括类、资源、配置项、方法等

(23)ctrl + h:查看类层次窗口

(24)ctrl + F12:查看当前类的所有方法

(25)ctrl + f:在当前窗口查找关键字

(26)ctrl + shift + f:在指定窗口查找关键字

(27)ctrl + shift + F10:运行当前类

(28)ctrl + tab:切换到其它目录

(29)alt + insert:创建构造方法、重写方法等

 

图1.3 截图3

(30)shift + enter:光标从当前位置往下创建一行,并移到下一行起始处

 

2、常用配置:

(1)设置字体:

File -> Settings -> Editor -> Font,设置为Consolas字体。

(2)设置IDEA字符编码:

File -> Settings ->Editor -> Code Style -> File Encoding,将上面的Global Encoding和Project Encoding都设置为UTF-8编码,以及下面的Properties Files的配置文件编码也改为UTF-8。

(3)设置智能提示忽略大小写:

File -> Settings ->Editor -> General -> Code Completion,将Case sensitive completion设置为None。

(4)配置git:

File -> Settings -> Version Control -> Git。

 

图2.1 截图4

(5)配置背景主题:

File -> Settings -> Appearance & Behavior,设置UI Options中Theme为Darcula的黑色背景。

(6)配置Maven:

File -> Settings -> Build,Execution,Deployment -> Build Tools -> Maven。

 

图2.2 截图5

(7)配置hints:
File -> Settings -> Editor -> General -> Appearance,将show parameter name hints的勾选去掉,即不显示方法参数提示。
(8)配置启动时打开的项目:
File -> Settings -> Appearance & Behavior -> System Settings,将Startup/Shutdown中的Reopen last project on startup的勾选去掉,即启动时不自动打开上次项目,而是让我们自己选择。

(9)设置几时自动换行:

File -> Settings -> Editor -> Code Style,将Right Margin改为120,即120个字符时会自动换行。

                                                             

                                                                                                                         图2.3 截图6

 

posted on 2018-09-19 21:41  kret  阅读(1470)  评论(0编辑  收藏  举报

导航