IntelliJ IDEA Tips: Maven Setup, Code Style, Shortcuts, Plugins, and More
This guide provides a comprehensive collection of IntelliJ IDEA tips covering Maven configuration, code‑style settings, key shortcuts, plugin installation, SVN handling, memory tuning, live templates, presentation mode, and many other practical adjustments to streamline Java development.
1. Maven configuration
1.在File->settings->搜索maven 2.Maven home directory--设置maven安装包的bin文件夹所在的位置 3.User settings file--设置setting文件所在的位置 4.Local repository--设置本地仓库
2. Set code line width in IDEA
1.在File->settings->Editor->Code Style 2.选择“Wrap when typing reaches right margin”实现自动换行 3.在File->settings->Code Style->Java中勾选“Ensure right margin is not exceeded”
3. Case‑insensitive code completion
1.打开File->settings->Editor->Code Completion 2.将Case sensitive completion设置为None
4. Force Maven dependencies update
1.手动删除Project Settings里的Libraries 2.Maven Project视图中clean,删除旧编译文件 3.右键项目->Maven->Reimport
5. IDEA configuration default location
1.C:\Users\ username \.IntelliJIdea14 为默认保存路径 2.可在%IDEA_HOME%/bin/idea.properties修改路径
6. Hide unwanted files/folders
File->Settings->File Type->Ignore files and folders 增加 *.iml, .idea
7. Switch to Eclipse keymap
File->Settings->Keymap->Keymaps改为 Eclipse copy
8. Default settings adjustments
File->Settings->Default setting
9. Common shortcut keys
Ctrl+Tab – 切换标签页 Ctrl+W – 选中上下文相关代码 Alt+Insert – 代码生成 Ctrl+Shift+A – 查找所有IDEA命令 Ctrl+Shift+Enter – 自动完成 Alt+Enter – 快速修复 Ctrl+Shift+Alt+T – 重构
10. Resolve shortcut conflicts
File->Settings->Keymap->Main menu->Edit->Find 改为 Ctrl+F / Ctrl+R
11. Show line numbers
File->Settings->Editor->General->Appearance->Show line numbers
12. Mark modified tabs with asterisk
Editor‑>General‑>Editor Tabs – 勾选 “Mark modified tabs with asterisk”
13. Disable automatic code suggestion
Preferences‑>IDE Settings‑>Editor‑>Code Completion‑>Autopopup documentation in (ms)
14. SVN sync issue fix
File‑>Settings‑>Subversion‑>General‑>Use command line client 指定 svn.exe 路径,避免路径中含空格
15. Ignore *.iml files in SVN
Editor‑>File Types‑>Ignore files and folders 增加 *.iml; .idea
16. Change editor font size
File‑>settings‑>EDITOR COLORS & FONTS‑>FONT‑>SIZE
17. IDEA encoding settings
File‑>SETTINGS‑>FILE ENCODINGS‑>IDE ENCODING / Project Encoding / Default for properties
18. Live templates
System.out.println 快捷输出: "abc".sout → System.out.println("abc");
19. Tomcat VM options
-Xms256m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=256m
20. Install plugins (e.g., FindBugs)
File‑>setting‑>plugins‑>Browse repositories 或 Install plugin from disk
21. Adjust IDEA memory parameters
%IDEA_HOME%/bin/idea.exe.vmoptions
22. Import Eclipse web project to Tomcat
在Facets中增加Web支持,在Artifacts中添加部署模块
23. Reduce CPU usage when opening JSP/Java files
File‑>settings‑>editor‑>inspection 关闭相关检查
24. Add Spring/Struts file support
Project Settings‑>Modules‑>右键项目添加相应支持
25. Auto‑compile on class change
File‑>setting‑>Build, Execution, Deployment‑>Compiler‑>Make project automatically
26. Generate serialVersionUID for Serializable classes
Preferences‑>Editor‑>Inspections‑>Serialization issues‑>Serializable class without ’serialVersionUID’ – Alt+Enter 自动生成
27. Presentation mode for distraction‑free coding
Alt+V → View → Enter Presentation Mode (退出同样操作)
28. Inject language for JSON strings
在双引号内 Alt+Enter → Inject language or reference → JSON 编辑完成后 Ctrl+F4 退出视图
29. Symbol search for method names
Ctrl+Shift+Alt+N 使用 Symbol 查找
30. Resolve Windows shortcut conflicts (e.g., Ctrl+Alt+↑)
右键桌面‑>图形选项‑>快捷键‑>禁用冲突快捷键
31. Fix comment formatting during code reformat
取消 enable javadoc formatting
END
IT Xianyu
We share common IT technologies (Java, Web, SQL, etc.) and practical applications of emerging software development techniques. New articles are posted daily. Follow IT Xianyu to stay ahead in tech. The IT Xianyu series is being regularly updated.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.