Intellij IDEA常用快捷鍵和一些配置——Mac版


常用的快捷鍵

代碼補全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 的快捷鍵 http://www.ituring.com.cn/article/37792

 

Eclipse 和 intellij的快捷鍵對照表

 

Eclipse IntelliJ IDEA Description
F4 ctrl+h show the type hierarchy
ctrl+alt+g ctrl+alt+F7 find usages
ctrl+shift+u ctrl+f7 finds the usages in the same file
alt+shift+r shift+F6 rename
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
ctrl+o ctrl+F12 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
ctrl + d ctrl + y delete current line
??? alt + h show subversion history
ctrl + h 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 + y ctrl + shift + z redo
ctrl + shift + c ctrl + / 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
none ? ctrl + alt + f7 to jump to one of the callers of a method
ctrl + shift + i alt + f8 evaluate expression (in debugger)
F3 ctrl + b go to declaration (e.g. go to method)

 refer http://www.catalysts.cc/en/wissenswertes/intellij-idea-and-eclipse-shortcuts/


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM