To quickly find and run an inspection, press Ctrl+Alt+Shift+I and start typing the name of the inspection or its group. Choose an inspection from the suggestion list and specify the scope.
You can view all statements within the method where certain exceptions can be thrown. Place the caret at the throws statement and press Ctrl+Shift+F7
To open your browser with the documentation page for the element at the caret, press Shift+F1 (View | External Documentation).
To use this feature, a browser must be selected on the Tools | Web Browsers page of the Settings/Preferences dialog Ctrl+Alt+S.
Kotlin is a powerful, concise and expressive language crafted by JetBrains.IntelliJ IDEA supports it out-of-the-box.To create a Kotlin file, right-click the target folder, and choose the corresponding option on the New menu
In IntelliJ IDEA Community, you can configure different copyright notices for different sets of files. For convenience, you can use variables. For example, use $ today.year to keep the year up to date. In the Settings/Preferences dialog Ctrl+Alt+S, select Editor | Copyright | Copyright Profiles, create a new profile, and add the text for your copyright notice using variables.
$today.year
使这一年保持最新。在 “ 设置/首选项 ” 对话框 Ctrl+Alt+S ,选择 “ 编辑器|版权 | 版权配置文件 ” ,创建新的配置文件,并使用变量添加版权声明的文本。To quickly wrap a code block in useful constructs, select it in the editor and press Ctrl+Alt+T (Code | Surround With).The list of available options or wrappers is context-sensitive and depends on the language. For example, you can surround html blocks with tags, and so on.
html
块,等等。Use Refactor | Copy to create a class which is a copy of the selected class.This is useful when you need to create a class similar to an existing one, and it’s not feasible to put shared functionality in a common superclass.
Refactor | Copy
创建一个类,该类是所选类的副本。当你需要创建一个类似于现有类的类,并且将共享功能放在公共超类中是不可行的,这一点非常有用。You can get familiar with the main features of the IDE by following these tips. You can try out the features without closing this dialog. If you close it, you can always get back to it by selecting Help | Tip of the Day from the main menu.
Help | Tip of Day
返回到它。Press Ctrl+D in the editor to duplicate the selected block, or the current line when no block is selected.
Code Completion can suggest a name for a variable when you declare it. For example, start typing private FileOutputStream and press Ctrl + 空格
private FileOutputStream
,然后按 Ctrl+空格Press Shift twice to search for a file, action, class, symbol, or even a UI element across your project. Pressing double Shift again will extend the search to non-project items. You can also click in the upper-right corner of the product window.
To switch between opened files and tool windows, use the Switcher Ctrl+Tab. For navigation, press and hold Ctrl (on Windows and Linux) / Ctrl (on macOS) and use the Up and Down arrow keys or Tab and Shift+Tab, and Alt. Press Delete or BackSpace to close an editor tab or hide a tool window.
You can create code constructs using statement completion. Start typing a method declaration, a method call or a statement such as if, do-while, try-catch, or return. Press Ctrl+Shift+Enter to complete the statement into a syntactically correct construct.
if、do while、try catch 或 return
之类的语句。按 Ctrl+Shift+Enter 将语句插入到语法正确的构造中。To navigate to the implementations of an abstract method, position the caret at its usage or its name in the declaration and press Ctrl+Alt+B.
You can drag an external file from Explorer or Finder and drop it onto the Favorites tool window Alt+2.
If you do not remember a live template abbreviation, press Ctrl+J to see a list of suggestions for the current context. For example, type it and press Ctrl+J to see what happens.
To see the inheritance hierarchy for the selected class, press Ctrl+H (Navigate | Type Hierarchy). You can also invoke the hierarchy view directly from the editor to see the hierarchy for the currently edited class.
Pressing the same shortcut after you have invoked Smart type completion (Ctrl+Shift+空格) when there’s an array of the expected type in the context will suggest getting an element from this array.
To quickly select the currently edited element (class, file, method, or field) in another view, for example, Project or Structure, press Alt+F1 or call Navigate | Select In.
Navigate | select in
。To use text patterns in Search Everywhere (double Shift) when searching for a class, file, or symbol. Use
*
andspace
:
*
stands for any number of arbitrary characters.- space marks the end of a pattern. The preceding string is considered not just a prefix but a whole pattern. The list of the suggested names is narrowed down accordingly.
*
和空间*
表示任意数量的任意字符。