Intellij IDEA 4 新特性 之 Code Editing (代码编辑)

原创 2004年04月15日 17:33:00

Editing files with syntax highlighting(文件编辑时语法突出)

IDEA supports the editing of Java™, JSP, XML, HTML files, as well as custom file types that can be easily defined to be recognized and properly highlighted by the editor.

(IDEA支持对 Java™, JSP, XML, HTML等文件的语法突出编辑,即使是自定义的文件,也可以通过代码编辑器来使得其可以被识别和语法突出化)

Advanced Code Completion(先进的代码完成功能)

Code completion

Basic code completion finalizes a class, method, variable name, and Java keywords, plus commonly used names for fields and variables depending on their type. It can be automatically invoked, popping up the available methods and fields list.

Basic代码完成 可以完成对类、方法、变量名和Java关键字的识别,根据不同的类型,可以从自动弹出的列表框中选择已有的方法和域 名)

The SmartType code completion filters the method and variable list to match the expected expression type. It works at the right-hand side of assignments, in variable initializers, return statements and anywhere else where IDEA can guess the expected type.


The Class Name code completion finishes a class name anywhere in the project or libraries independently of imports in the current file.

Class Name 代码完成可以在任何工程、库以及当前独立的文件中帮你完成类名字的书写)

Closing brace auto-insert(复合语句的自动插入(前后括号自动匹配))

Auto Indent

Start a code block with an opening curly brace character and press Enter.
The corresponding closing brace is automatically inserted with the indentation specified in your preferences.


Matched brace highlighting(匹配括号的突出显示)

Brace matching

Place the Editor caret just after a closing (or just before an opening) brace or bracket of any type. If it is correctly matched, the matching pair highlights with light blue. If there is no matching bracket, the unpaired bracket highlights as a compile error. (You can change the default highlight colors in your configuration).


Pasted text auto-indent(粘贴代码自动缩进)

Formatted from paste

Paste a block of text into your code and IDEA automatically indents it to fit the new location.


Live Templates(动态模板)

Live template

Live Templates provide a fast way to code many typical constructs. Just type the Live Template name, press Tab, and the relevant code... simple or highly complex... is written to your file instantly. When you insert code from a Live Template, IDEA analyzes your existing code and suggests correct values for the template’s variables. Now you can apply Live Templates not only at a particular caret position, but for selected blocks of code/text as well.


Express code commenting(快速代码注释)

Use a single keystroke to quickly comment/uncomment a selected line or block with either block (/*…*/) or line (//…) comments. Comments insert at the first column, or at the indentation level, depending on your preferences.


Popup parameter info(参数弹出提示)

Parameter info

When coding a new method call, a tooltip showing the target method’s signature pops up after you type the opening “(” character or invoke code completion features. The parameter highlighted in bold is the one on which the caret is currently positioned. You can control the popup interval or disable the popup completely in Completion settings.

(当输入一个新的方法时,在输入“(”后就会有这个方法参数的弹出提示,当前参数将会以粗体显示,你可以在Completion settings中控制是否弹出,和弹出延时)

Code folding(代码折叠)

Code folding

Easily “fold” and “unfold” methods, Javadoc comments, or blocks of import statements, putting distracting detail out of your way. Fold/unfold a single block or everything in the file at once with a single keystroke.


Mouse over «folded» code icons to pop up the hidden detail for quick examination.


Split-pane editor(双块代码编辑)

Split-pane editor

Split the Editor into two half panes to work in two different places in the same file simultaneously. Move the pane splitters to adjust the size of the panes.


Clipboard stacking(超级剪贴版)

Clipboard stacking

Now store multiple clipboard entries and access them with a single shortcut. Customize the number of entries that can be stored in the clipboard stack.


React Native常用IDE推荐与安装配置

React Native常用IDE推荐与安装配置(一)前言 上一讲提到了React Native框架安装和运行,以及创建了一个项目并介绍这个项目结构。这样介绍项目项目结构其实极其不方便,这一节将介绍...
  • u014484863
  • u014484863
  • 2016年06月01日 11:05
  • 19054

通过编写插件个性化你的IntelliJ IDEA

还记得2013年半夜观看Google I/O大会,一堆眼花缭乱的数字广告后,主持人提到这次I/O的主角是开发者,接下来给大家演示一系列开发工具和服务时,心想:可能无非就是一些向开发者开放的Googl...
  • ouyb7873
  • ouyb7873
  • 2016年07月21日 10:47
  • 5237

IDEA 配置优化 提高开发效率

IDEA 配置优化,提高开发效率去掉烦人的indent提示 如何去掉呢? 打开IDEA 的preferences|Editor|Code Style, 去掉下图中的两个勾选: 设置文件的模板我...
  • hw1287789687
  • hw1287789687
  • 2016年04月04日 20:35
  • 15356

IntelliJ IDEA中关于get、set方法Code template的编辑,用于修改get、set注释

本文主要介绍IntelliJ IDEA中关于get和set的注释添加问题,也介绍了MyEclipse中get和set的注释添加方法....
  • billisky
  • billisky
  • 2017年10月31日 16:03
  • 596

Intellij idea2017版本的新特性简介

原文地址: Intellij idea2017版本的新特性特别多,这里就简单列了一下,全文在https...
  • tanga842428
  • tanga842428
  • 2017年05月05日 18:19
  • 3257

IntelliJ IDEA 11新特性介绍

本文来源于我在InfoQ中文站翻译的文章,原文地址是:不久前JetBrains发布了IDEA 11,在性能、Gro...
  • ricohzhanglong
  • ricohzhanglong
  • 2012年05月14日 16:10
  • 3460

IntelliJ IDEA 12新特性:为Android开发者提供新的XML重构工具

一直用IntelliJ IDEA做Android开发,感觉挺顺手。刚刚最新的IntelliJ IDEA 12(What's New?)发布,包含众多的新特性,我拣了个Android开发框架相关的特性给...
  • dyllove98
  • dyllove98
  • 2013年04月14日 11:01
  • 1893

Intellij IDEA无法启动:Failed to create JVM:error code -4

Intellij IDEA启动 Failed to create JVM:error code -4
  • helihongzhizhuo
  • helihongzhizhuo
  • 2015年10月26日 11:27
  • 1597

Intellij IDEA特航特性top20.pdf

  • 2015年05月06日 22:19
  • 1.42MB
  • 下载

IntelliJ IDEA 的 20 个代码自动完成的特性

在这篇文章中,我想向您展示 IntelliJ IDEA 中最棒的 20 个代码自动完成的特性,可让 Java 编码变得更加高效。对任何集成开发环境来说,代码的自动完成都是最最重要的一项功能,它根据你输...
  • walter_chan
  • walter_chan
  • 2016年06月09日 17:53
  • 2141
您举报文章:Intellij IDEA 4 新特性 之 Code Editing (代码编辑)