【Intellij Idea】Intellij Idea常用配置设置
【Intellij Idea】Intellij Idea常用配置设置
1、配置Intellij Idea的配置文件从默认c盘转移到其他盘符
找到Intellij idea的安装文件,在bin目录下找到idea.properties配置文件,如下把Idea的配置文件夹和Idea的系统文件夹配置到除c盘外的其他盘符。
<span style="color:#000000"><code><span style="color:#880000">#---------------------------------------------------------------------</span>
<span style="color:#880000"># Uncomment this option if you want to customize path to IDE config folder. Make sure you're using forward slashes.</span>
<span style="color:#880000">#---------------------------------------------------------------------</span>
idea.config.path=<span style="color:#009900">D</span><span style="color:#009900">:/java/IntellijIdea/</span>.<span style="color:#009900">IntelliJIdea</span>/config
<span style="color:#880000">#---------------------------------------------------------------------</span>
<span style="color:#880000"># Uncomment this option if you want to customize path to IDE system folder. Make sure you're using forward slashes.</span>
<span style="color:#880000">#---------------------------------------------------------------------</span>
idea.system.path=<span style="color:#009900">D</span><span style="color:#009900">:/java/IntellijIdea/</span>.<span style="color:#009900">IntelliJIdea</span>/system</code></span>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
2、设置快捷键习惯风格为eclipse的习惯:
“ctrl+alt+s”进入设置菜单,在搜索栏输入“keymap”,然后如图选择“eclipse”这样大多数快捷键就会跟eclipse工具里的一致了。
3、设置“字体”:
进入设置菜单,如下图选择自己喜欢的字体,当然我还是钟爱“consolas”字体的:
4、设置自己的文件注释模板:
进入设置,然后找到如下位置,然后就可以根据自己的习惯去设置:
<span style="color:#000000"><code> <span style="color:#880000">/**
*Created with ${PRODUCT_NAME}
*Created By Kinsey
*Date: ${DATE}
*Time: ${TIME}
*/</span></code></span>
- 1
- 2
- 3
- 4
- 5
- 6
5、设置你的IDEA的字符编码
6、取消自带的svn的设置,很多刚开从svn下载项目的时候会出问题,是因为此时他指定了自己默认的svn(全部取消都可以)
7、给项目设置对应的jdk编译环境
8、把lib包进入到“buildpath”中
经常能用到的几个快捷键
“psvm”:快速创建main方法
<span style="color:#000000"><code> <span style="color:#000088">public</span> <span style="color:#000088">static</span> <span style="color:#000088">void</span> <span style="color:#009900">main</span>(String[] args) {
}</code></span>
- 1
- 2
- 3
“sout”:快速创建print语句
<span style="color:#000000"><code>System<span style="color:#009900">.out</span><span style="color:#009900">.println</span>()<span style="color:#880000">;</span></code></span>
- 1
“alt+enter”:快速补全
例子1(对于局部变量的自动补全):在对象a的位置“alt+enter”自动完成局部变量的补全创建工作
<span style="color:#000000"><code>User a =<span style="color:#009900"> new User() ;</span></code></span>
- 1
例子2:完成类型的强制转换,如下
<span style="color:#000000"><code> User user = jdbc.queryForObject(sql, <span style="color:#000088">new</span> <span style="color:#4f4f4f">Object</span>[]{id}, <span style="color:#000088">new</span> UserMapper());</code></span>
- 1
鼠标放在等号右边然后“alt+enter”将结果转换成“User”
<span style="color:#000000"><code> User user = (User)jdbc.queryForObject(sql, <span style="color:#000088">new</span> <span style="color:#4f4f4f">Object</span>[]{id}, <span style="color:#000088">new</span> UserMapper());</code></span>
- 1
例子3、自动实现接口的方法:
假设有一个“Dao接口”里面定义了许多方法,完成它的实现类的时候,光标在要实现的接口附近,然后“alt+enter”,如图自动实现接口的方法。
……等等。“alt+enter”还是蛮强大的。
“shift+alt+r”:快速重命名
“alt+insert”:这个快捷键使用频率也是很高的
①:自动创建满足自己需求的构造方法
②:快速实现setget方法
③:快速创建“toString()”
等等
“ctrl+shift+r”:快速打开资源文件
“ctrl+l”:快速定位到文件中行的位置
“shift+ctrl+alt+s”:快速进入项目结构设置
“ctrl+alt+s”:快速进入设置菜单
“shift+alt+z”:快速创建ifelse或者快速完成try catch
上一篇: 新一代游戏神器 聊聊Win11游戏特性
推荐阅读
-
IntelliJ IDEA 中使用jRebel进行 Java 热部署教程图解
-
IntelliJ IDEA中使用mybatis-generator的示例
-
Intellij IDEA如何自定义注释模板的实现方法
-
IntelliJ IDEA 使用经验总结(推荐)
-
解决Intellij IDEA 使用Spring-boot-devTools无效的问题
-
Intellij IDEA常用快捷键介绍 Intellij IDEA快捷键大全汇总
-
Intellij Idea中进行Mybatis逆向工程的实现
-
IntelliJ IDEA全局内容搜索和替换教程图解
-
idea如何修改快捷键为Eclipse风格?IntelliJ IDEA设置快捷键及快捷键风格的方法
-
新手idea初始化配置(idea设置格式化模板分享)