把工具熟练好,工作起来才会得心应手,事半功倍。大名鼎鼎的intelliJ IDEA功能强大,对于JAVA开发者而言更是利器,熟练地使用IDEA必然是重中之重。
工欲善其事,必先利其器
Prerequisite plugins
-
representation assistant
This plugin is a great and useful tool; It shows name and Win/Mac shortcuts of any action you invokes.
-
Key promoter X
The plugin helps you to learn essential shortcuts while you are working. When you use the mouse on a button inside the IDE, the plugin shows you the keyboard shortcut that you should have instead.
Search Everywhere
https://www.jetbrains.com/help/idea/searching-everywhere.html
Started
First, set keymap type: Mac OS 10.5+
-
Press
⇧
twice to open the search window, you can search everywhere you know. (include class files symbols and actions). Press double⇧
again, IDEA will select or unselect the Include non-project items checkbox. -
Start typing your query, IDEA lists the results dividing them into sections where your query is found. press
⌘↑
or⌘↓
to jump between sections. And you can press⇥
to switch the scope of your search to classes files symbols or actions.You can use the following shortcuts to open the search window the needed scope right from the start.
⌘O
: finds a class by name⇧⌘O
: finds any file or directory by name⌥⌘O
: finds symbol; Also you can search like/**/**
⇧⌘A
: finds an action by name.
-
Press
⌥↑
or ``⌥↓` to switch history you searched.
basis
-
Search for settings
Press
⇧
twice to open thie search window and type/
. IDEA lists the available groups of setting. Then pressEnter
to select the options. -
Search for actions
- Press ⇧ twice to open the search window.
- In the search field, type, for example,
Push
. - IDEA displays the
Push
action in the Action section together with its shortcut.
-
Search for abbreviations
You alse can assign a short code for the action and use it to search for such action and qiuckly access it, For example, assign an abbreviation for Color Picker
-
In the Settings/Preferences dialog
⌘,
, go to Keymap. From the options on the right select Other|Show color Picker. -
From the context menu, select Add Abbreviation
-
In the dialog that opens, specify the abbbreviation you are going to use, for example cp and click ok.
-
When you type cp in the search field ,IDEA will display the item to which you have assigned your abbreviation. Press
⏎
to access the Color Picker dialog.
you can input everything ,also example: service.redisservice.lget – scope of symbols. So you are not have to rely on mouse so much now.
-
Away from your mouse
⌘E
is your friend command. Then idea will lists recent files after pressing. (E
presents Edited files here)⌘⇧E
: shows the recent locations.⌘1
: shows your project; Press twice to close the sidebar.←
: select parent node when your cursor on the project.→
: select child node when your cursor on the project.Enter
: display the code where your cursor are.⌘↓
: jump to the code where your cursor are.⌘N
: create new file. Example create directoryaa/aaa/aaa/aa
.⌘+F12
: shows file structure. Press twice also to show the Inherited members.⌘[
: To navigate backwards, press.⌘]
: To navigate forward, press.⌘⇧⌫
: To navigate to the last edited location, press .⌘,
: shows the Settings/Preferences dialog.⌘B
: shows the class where declarations are.⌘⌥B
: show all the implements.⌘U
: go to the super class^H
: shows the Type Hierarchy
Hide All The Windows
-
You can hide all the windows with a qiuck shortcut
⌘⇧F12
. You can also do is enter what called distriction-free. -
Hiden the navigation bar, if you ever want it. You just invoke it via
⌘↑
-
You can resize windows without using the mouse via
⌘⇧→
or⌘⇧←
. -
Press
⌥↓
or⌥↑
to select code. Select the method and then the class and then the entire outer class and then the entire package or shrink this as well.⌥↓
: shrink selection.⌥↑
: extend selection.
-
Place the cusor on an entire line, if you wan to move code you just pres
⇧⌥↑
or⇧⌥↑
⌥⇧↓
: move ling up.⌥⇧↑
: move line down.
-
⌘D
: duplicate line. -
^G
: via press many times to place multiple cursors to select the words. -
^⌘G
: select all occurred words. -
If wan to clean up code, you just select this code and hit
^⌥I
. Or you wan to clean up entire code ,so just search clean up in Search Everywhere(hit twice⇧
).
Some Tips
- Edit JSON ----use language injection
- Press
⌥+Enter
and select inject language and select JSON, then IDEA interprets it as JSON and press⌥+Enter
and select Edit JSON fragment . Also on regExp,html,js,ect.
- Press
⌘J
: insert live templates; example sout ,psvm ,ect. You also can create yourself template ,example try/catch act.- ``⌘⇧+Enter`: Complete Current statement.
- if you don’t doing extra library or files supported for javascript with the nodeJs plugin, you can press
⌘,
to open the setting dialog and then to search "library " to unchecked the nodeJs plugin. - If hate the inspection of IDEA, you can change the inspection into another one you like.
- check inspection: Search Everywhere -> run inspection -> you want to check
F2
: NextHighlighted Error.⇧F2
: PreHighlighted Error.- analyse dependency matrix.
- “^`”: quick switch scheme.
本文作者: 坦吉
本文链接: https://supertange.github.io/post/idea-intellij-bi-xu-zhang-wo-de-shi-yong-ji-qiao
版权声明: 本博客所有文章除特别声明外,转载请注明出处!