工欲善其事,必先利其器 —— IDEA使用技巧1

把工具熟练好,工作起来才会得心应手,事半功倍。大名鼎鼎的intelliJ IDEA功能强大,对于JAVA开发者而言更是利器,熟练地使用IDEA必然是重中之重。

工欲善其事,必先利其器

Prerequisite plugins

  1. representation assistant

    This plugin is a great and useful tool; It shows name and Win/Mac shortcuts of any action you invokes.

  2. 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+

  1. 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.

  2. 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.
  3. Press ⌥↑ or ``⌥↓` to switch history you searched.

basis

  1. Search for settings

    Press twice to open thie search window and type /. IDEA lists the available groups of setting. Then press Enter to select the options.

  2. Search for actions

    1. Press ⇧ twice to open the search window.
    2. In the search field, type, for example, Push.
    3. IDEA displays the Push action in the Action section together with its shortcut.
  3. 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

    1. In the Settings/Preferences dialog ⌘,, go to Keymap. From the options on the right select Other|Show color Picker.

    2. From the context menu, select Add Abbreviation

    3. In the dialog that opens, specify the abbbreviation you are going to use, for example cp and click ok.

    4. 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

  1. ⌘E is your friend command. Then idea will lists recent files after pressing. ( E presents Edited files here)
  2. ⌘⇧E: shows the recent locations.
  3. ⌘1: shows your project; Press twice to close the sidebar.
  4. : select parent node when your cursor on the project.
  5. : select child node when your cursor on the project.
  6. Enter: display the code where your cursor are.
  7. ⌘↓: jump to the code where your cursor are.
  8. ⌘N: create new file. Example create directory aa/aaa/aaa/aa.
  9. ⌘+F12: shows file structure. Press twice also to show the Inherited members.
  10. ⌘[: To navigate backwards, press.
  11. ⌘]: To navigate forward, press.
  12. ⌘⇧⌫: To navigate to the last edited location, press .
  13. ⌘,: shows the Settings/Preferences dialog.
  14. ⌘B: shows the class where declarations are.
  15. ⌘⌥B: show all the implements.
  16. ⌘U: go to the super class
  17. ^H: shows the Type Hierarchy

Hide All The Windows

  1. You can hide all the windows with a qiuck shortcut ⌘⇧F12. You can also do is enter what called distriction-free.

  2. Hiden the navigation bar, if you ever want it. You just invoke it via ⌘↑

  3. You can resize windows without using the mouse via ⌘⇧→ or ⌘⇧←.

  4. 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.

    1. ⌥↓: shrink selection.
    2. ⌥↑: extend selection.
  5. Place the cusor on an entire line, if you wan to move code you just pres ⇧⌥↑ or ⇧⌥↑

    1. ⌥⇧↓: move ling up.
    2. ⌥⇧↑: move line down.
  6. ⌘D: duplicate line.

  7. ^G: via press many times to place multiple cursors to select the words.

  8. ^⌘G: select all occurred words.

  9. 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

  1. Edit JSON ----use language injection
    1. 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.
  2. ⌘J: insert live templates; example sout ,psvm ,ect. You also can create yourself template ,example try/catch act.
  3. ``⌘⇧+Enter`: Complete Current statement.
  4. 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.
  5. If hate the inspection of IDEA, you can change the inspection into another one you like.
  6. check inspection: Search Everywhere -> run inspection -> you want to check
  7. F2: NextHighlighted Error.
  8. ⇧F2: PreHighlighted Error.
  9. analyse dependency matrix.
  10. ^`”: quick switch scheme.

本文作者: 坦吉
本文链接: https://supertange.github.io/post/idea-intellij-bi-xu-zhang-wo-de-shi-yong-ji-qiao
版权声明: 本博客所有文章除特别声明外,转载请注明出处!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值