idea有没有类似eclipse的organizeintellij idea importt的功能

IntelliJ IDEA 13: Importing Code Formatter Settings from Eclipse - 推酷
IntelliJ IDEA 13: Importing Code Formatter Settings from Eclipse
Many development teams are using more than one IDE because it’s a very personal matter, and people always seek what best suits their individual needs. And then there’s collaboration, and it sometimes is harder when different sorts of IDEs are involved. One of the most frequently encountered problems is code style, that has to be consistent in the entire project.
You may have heard about Eclipse Code Formatter, a quite popular IntelliJ IDEA plugin that lets you, what else, — use Eclipse’s code formatter with IntelliJ IDEA. In most cases the plugin is fine, but because it’s calling Eclipse API directly from IntelliJ IDEA, there can be problems with processing such actions as refactoring, code generation, etc., so it’s not always that helpful.
Now things are going to be a bit easier, because IntelliJ IDEA 13 is capable of importing code formatter settings from Eclipse without the use of any plugins. All you need is to export settings from Eclipse (go to Eclipse’s
Preferences
Code Style
and export the settings to an XML file via the
Export All
button.), and then open IntelliJ IDEA
Code Style
, and import that XML file by simply clicking
Currently, IntelliJ IDEA supports the import of the following settings:
Right margin, Formatter on/off tags
Indentation
Indent size
Usage of ‘Tab’ character
Usage of Tab only for leading indentation (Smart Tabs)
Indent ‘case’ branches from ‘switch’
Indent class members
Keep comment at first column
Spaces (Java)
Before/after comma (as set for Eclipse method declaration parameters)
After comma in type arguments
Within array initializer braces
Within brackets (in array reference)
Within parentheses of: annotation, ‘for’, ‘if’, ‘catch’ ’while’, ’switch’, method, empty method, parenthesized expression, method call, type cast, ‘synchronized’
Before parentheses of: ‘try’, ‘for’, ’while’, ‘switch’, method, ’if’, ‘catch’, method, method call, ‘synchronized’.
After type cast
Around unary, assignment operators (if it’s set for ‘before’ and ‘after’ in Eclipse).
Before opening brace of: array initializer, ‘switch’
Before ‘?’ in conditional expression
Space before/after ‘:’ in conditional expression
Space around binary operators (a single Eclipse setting is mapped to multiple IntelliJ IDEA’s settings)
Blank lines
Around fields and methods
Before/after package
Before/after imports
Before method body
Keep blank lines in code (number of empty lines to preserve)
New line before: closing brace in array initializer, ‘else’ in ‘if’ statement, ‘finally’ and ‘catch’ in ‘try’ statement, binary operator (if wrapped)
New line after: &opening brace in array initializer
Special ‘else if’ treatment (compact ‘else if’)
Keep simple blocks in one line
Keep control statements in one line
Alignment of: array initializer expressions, arguments in method declarations and calls, field declarations, extends list, assignments, binary expressions, ‘throws’ clause, resources in ‘try’.
Brace style for: code blocks, methods and classes
Enable JavaDoc formatting
Blank lines in JavaDoc
Keep in mind that code style settings in IntelliJ IDEA and Eclipse are fundamentally different and can’t be mapped one to another with complete accuracy, e.g. you can’t tell IntelliJ IDEA to put space after ‘(‘ or not to put it before ‘)’. However, we’re constantly working on improving this interoperability, and your feedback with problems and use cases is very appreciated.
What’s planned for the nearest future:
More settings (based on your feedback, tell us what’s important for you.)
More languages.
Working directly with .settings/org.eclipse.jdt.core.prefs, without the need to use the XML export/import.
Importing of Conventions (from “Java Code Style”), e.g. field prefixes.
Importing of Code templates and Organize imports settings.
Feel free to share your feedback here, or in our
Develop with Pleasure!
已发表评论数()
已收藏到推刊!
请填写推刊名
描述不能大于100个字符!
权限设置: 公开
仅自己可见
正文不准确
排版有问题
没有分页内容
视频无法显示
图片无法显示idea有没有类似eclipse的organize import的功能_百度知道
idea有没有类似eclipse的organize import的功能
提问者采纳
请继续追问。你光标点击空白处按alt+enter你好,但是它有多种选项,mac电脑是command+ctrl+o如果我的回答没能帮助您,命令是ctrl+alt+o,而不要点在报错的红线上按有自动导入
来自团队:
其他类似问题
为您推荐:
eclipse的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁Intellij IDEA常用快捷键和一些配置——Mac版 - Likwo - 博客园
常用的快捷键
代码补全Ctrl + space
删除行Command + D
注释Command + /
导入包Command + shift + O
格式化代码Command + shift + F
运行Ctrl + Alt + R
Incremental SearchCommand + J & 在编辑器中实现快速查找功能,通过上下箭头进行上下文搜索
Quick Definition &Command + Y &它会弹窗显示建议列表中的方法定义的内容,如果你不确定要使用哪个方法
Find NextCommand + K&
Find &PreviousCommand + shift + K
详细方法、类Ctrl + 点击类名、方法
Ctrl+Alt+ left/right 返回至上次浏览的位置
Command + F12 类似eclipse 的ctrl + O的功能outline
调整界面为酷酷的黑色
Preferences=&Appearance=&theme=&Darcula
设置快捷键:
Preferences=&keymaps
自动补全:
Mac下默认是clt+space,可以使用keymaps=&Main menu=&Code=&Competion设置。比Eclipse好的地方是Spring、Maven的xml,乃至freemarker模板以及iBatis的sqlmap都支持高亮和自动补全。
去除自动补全的大小写敏感:
不知道多少童鞋和我一样被Eclipse惯坏了,使用自动补全完全不注意大小写的,IntelliJ默认区分大小写,很是让人难过。不过在Editor=&Code Completion里把Case sensitive completion设置为None就可以了。
自动展开目录
Eclipse有个打开文件就自动展开目录的功能,在IntelliJ里从Project左边栏的齿轮上选择Autoscroll to Source和Autoscroll from Source都勾选上即可。
IntelliJ默认是不会自动编译项目的,所以在run之前会有个make的过程,习惯自动编译项目的可以在这里打开:Compiler=&make project automatically。因为IntelliJ项目空间不大,所以开启之后也不会像Eclipse一样出现build workspace很久的情况。
另外一个 intelliJ 的快捷键&.cn/article/37792
Eclipse 和 intellij的快捷键对照表
IntelliJ IDEA
Description
show the type hierarchy
ctrl+alt+g
ctrl+alt+F7
find usages
ctrl+shift+u
finds the usages in the same file
alt+shift+r
ctrl+shift+r
ctrl+shift+N
find file / open resource
ctrl+shift+x, j
ctrl+shift+F10
run (java program)
ctrl+shift+o
ctrl+alt+o
organize imports
show current file structure / outline
ctrl+shift+m
ctrl+alt+V
create local variable refactoring
syso ctrl+space
sout ctrj+j
System.out.println(&&)
alt + up/down
ctrl + shift + up/down
move lines
delete current line
show subversion history
ctrl + shift + f
search (find in path)
&semi& set in window-& preferences
ctrl + shift + enter
if I want to add the semi-colon at the end of a statement
ctrl + 1 or ctrl + shift + l
ctrl + alt + v
introduce local variable
alt + shift + s
alt + insert
generate getters / setters
ctrl + shift + f
ctrl + alt + l
format code
ctrl + shift + z
ctrl + shift + c
comment out lines (my own IDEA shortcut definition for comment/uncomment on german keyboard layout on laptop: ctrl + shift + y)
ctrl + alt + h
ctrl + alt + h (same!)
show call hierarchy
ctrl + alt + f7
to jump to one of the callers of a method
ctrl + shift + i
evaluate expression (in debugger)
go to declaration (e.g. go to method)
&refer&http://www.catalysts.cc/en/wissenswertes/intellij-idea-and-eclipse-shortcuts/idea有没有类似eclipse的organize import的功能_百度知道
idea有没有类似eclipse的organize import的功能
提问者采纳
而不要点在报错的红线上按 有自动导入你好。 你光标点击空白处按alt+enter,但是它有多种选项, 命令是ctrl+alt+o,请继续追问,mac电脑是command+ctrl+o 如果我的回答没能帮助您
其他类似问题
为您推荐:
eclipse的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁

我要回帖

更多关于 idea import eclipse 的文章

 

随机推荐