/** * Objects * Keys * @author ${USER} * @create ${DATE} ${TIME} */
JetBrain Idea Tips |
JetBrain Idea Tips
reference
IntelliJ IDEA神器使用技巧
https://www.imooc.com/learn/924
project struct- facets
plugin
yaml autocomplete
alibaba cloud toolkit
用于测试或发布
Lombok
https://projectlombok.org/setup/intellij
https://github.com/mplushnikov/lombok-intellij-plugin
重要步骤
enable Annotation processing
"Settings > Build > Compiler > Annotation Processors"
module
1. New Project
Empty Project
import Module
加入在开发项目
加入一方依赖项目
issue
[RMI TCP Connection(2)- sun.rmi.server.call DEBUG - RMI TCP Connection(2)-exception:
javax.management.InstanceNotFoundException: DefaultDomain:type=Endpoint,name=beansEndpoint
The problem was IntelliJ's default server configurations. You just need to remove the 'Enable launch optimization' and 'Enable JMX agent' checkboxes, then it works!
Steps:
1. run - Edit Configurations
2. choose your project
3. remove the 'Enable launch optimization' and 'Enable JMX agent' checkboxes
IDEA报错:"xxx包不存在" 或 "找不到符号"
首先查看maven设置,注意:不要使用默认的maven的版本。
刷新一下maven依赖 Reimport all maven projects
注意编码选择设置为UTF-8,不要使用默认配置
最后,重启一下idea,好让各种更改重置。
Invalidate caches and restart
添加module,但git没看到
File - settings- Version Control - click +
resource
vmoption : -Dconfig="C:\WORKSPACE\src\com.xxx\xxx\xxx-xxx\xxx"
prog args:
--spring.config.location="C:\WORKSPACE\src\com.xxx\xxx\xxx-proj\demo\xx\xxx\xxx\application.yml"
--spring.config.location="C:/WORKSPACE/src/com.xxx/xxx/xxx-xxx/xxx/"
--spring.cloud.bootstrap.location="C:/WORKSPACE/src/com.xxx/bootstrap.yml"
spring boot开发
热更新
热部署
卡
可能是 Code With Me 和 Space 引起的,在之前没有这 2 插件的时候也没这么明显的卡顿感
JDK version the IDE will run under
快捷键
ref
alt
Alt+Shift+F
收藏
ctrl
shift
十大Intellij IDEA快捷键
智能补全:Ctrl+Shift+Space
自我修复:Alt+Enter
重构一切:Ctrl+Shift+Alt+T
创造万物:Alt+Insert
自动完成:Ctrl+Shift+Enter
无处藏身:Shift+Shift
发号施令:Ctrl+Shift+A
代码生成:Template/Postfix +Tab
选你所想:Ctrl+W
切来切去:Ctrl+Tab
live template
psfi
public static final int
file header
File >> Settings >> Editor >>Code Style >> File and Code Templates>>Includes >> File Header
复制,小心看不见的空字符问题
/**
* Objects
* Keys
* @see <a href="http://w..">www</a>
* @author ${USER}
* @create ${DATE} ${TIME}
*/
/** * Objects * Keys * @author ${USER} * @create ${DATE} ${TIME} */
打开idea.exe.vmoptions(win32bit)or idea64.exe.vmoptions(win64bit),新建一行,添加-Duser.name=whatsyourname
psfs
public static final String
tips
Intellij IDEA 鼠标放到类,方法,变
量上 显示完整java doc注释
Show quick doc on mouse move
打开file-->setting-->Editor-->General,搜索show,然后勾选上Show quick documentation on mouse move(将信息在鼠标移动到方法上时进行提示)
http://www.ibloger.net/article/2373.html
更新snapshot
Build Tools - Maven - always update snapshots
IDEA导出可执行jar包
idea
File–>Project Structure
from modules with dependencies
main class
mainefest
其他方法 maven/gradle plug
assembly
build
package
deploy 发布到代码库
debug console output size
idea.properties
idea.cycle.buffer.size=1024
Settings - Editor - General - Console - Override console cycle buffer size (1024->4096)
enable assertions
vm options
-ea or -enableassertions
disable duplicate code detection
File → Settings → Editor → Inspections → General → Duplicated code fragment
generating serialVersionUID
File → Settings... → Inspections → Serialization issues → Serializable class without 'serialVersionUID'` enabled
auto reformat comments
1. Join Lines ( Ctrl + Shift + J ). You have to select the lines you want to join first. To wrap long comments enable Settings. Code Style.
...
Set the Code Style > Java > JavaDoc > Wrap at right margin setting.
Select the full lines of the entire JavaDoc comment.
2.Reformat Code (Ctrl-Alt-L or ⌥⌘L).
(临时用)取消单元测试
Idea > View > Tool Windows > Maven Projects > Skip Tests Mode
@formatter:off
@formatter:on
File → Settings → Code Style → Fromater Control : Enable Formater markers in Comments
plugins
IDEA中添加jQuery自动代码提示
1. 打开Settings,Languages & Frameworks > JavaScript > Libraries
codehelper.generator
GenerateAllSetter
builder generator
vuejs
add vuejs plugin
File -> Settings -> Plugins-vuejs
add vue filetype
File -> Settings -> Editor -> File Types -> HTML
点Registered Patterns下的+,添加 *.vue
设置JS
输入vue init webpack project-name
spring assistant
https://github.com/1tontech/intellij-spring-assistant/releases
yaml 配置 跳转到源码
grpc proto import not found
设置Protocol Buffers插件的默认路径
File->Settings->Languages&Frameworks->Protocol Buffers
file://C:/WORKSPACE/src/com.xxx/xxx-proto/src/main/proto
导出run/debug configurations
check the share through VCS option
the script will be stored under $projectDir/.idea/runConfigurations
.gitignore
!.idea/runConfigurations
sdk
File–>project Structure–>SDK
IntelliJ IDEA 自动导入包
Settings-Editor-General-Auto import
Optimize imports on the fly
自动优化导入包,比如自动去掉一些没有用到的包。
Add unambiguous imports on the fly
自动帮我们导入需要用到的包。但是对于那些同名的包,还是需要手动 Alt + Enter 进行导入的
Never use wildcard imports
go to Preferences (⌘ + , on macOS / Ctrl + Alt + S on Windows) > Editor > Code Style > Java > Imports tab set Class count to use import with '*' and Names count to use static import with '*' to a higher value.
Utf8
全局
File菜单->Other Settings->Default Settings
当前项目
Settings-Editor-File Encodings
取消idea默认打开工程
Appearance & Behavior>System Settings
去掉默认的勾选Reopen last project on startup