IDEA 快捷鍵展示(內含動圖演示)

IDEA 快捷鍵展示(內含動圖演示)

原由

idea 作為專業的代碼編輯器,提供了大量的快捷方式來幫助我們更好、更快的寫代碼,還不易出錯。

代碼簡稱

psvm = public static void main

fori = for (int i = 0; i < ; i++)

sout = System.out.println()

IDEA 快捷鍵展示(內含動圖演示)

更加強大的簡寫:

IDEA 快捷鍵展示(內含動圖演示)

IDEA 快捷鍵展示(內含動圖演示)

更多可以到 preference -> editor -> live template 中查看

Command + Shift + Enter 自動添加分號或大括號

Command + Mouse 跳到方法的定義處

Command + shift + Mouse 跳到方法的實現處

IDEA 快捷鍵展示(內含動圖演示)

Command +Alt + T 自動生成環繞代碼

Command + / 添加或去掉行註釋

Command + Shift + / 添加或去掉塊註釋(測試與idea 的菜單快捷鍵衝突,會調出help)

IDEA 快捷鍵展示(內含動圖演示)

Command + Option + L 格式化代碼(包括去掉無用imports)

Shift + Tab 回退一個 tab

Command + V 粘貼拷貝的內容

Command + Shift + V 選擇要粘貼的內容(從以前拷貝過的內容中選擇)

IDEA 快捷鍵展示(內含動圖演示)

Command + D 複製當前選中的代碼.

Command + delete 刪除當前行.

Option + delete 刪除當前單詞.

IDEA 快捷鍵展示(內含動圖演示)

Shift + Enter 在光標所在行後插入一行

Command + Option + Enter 光標所在行前插入一行

Command + Shift + U 選中字符toggle 大小寫

IDEA 快捷鍵展示(內含動圖演示)

Command + 減號 摺疊當前代碼段

Command + 加號 展開當前代碼段

Command + Shift + 減號 摺疊所有代碼段

Command + Shift + 加號 展開所有代碼段

IDEA 快捷鍵展示(內含動圖演示)

Fn + Shift + F6 重構當前變量/函數/類 名

Command + N 生成 constructor/getter/setter 等

IDEA 快捷鍵展示(內含動圖演示)

代碼查找

Command + o 查找類

Command + Shift + o 查找文件

Command + Option + o 查找Symbols

IDEA 快捷鍵展示(內含動圖演示)

Command + F 當前文件查找

Command + Shift + F 全局查找

導航

Command + Option + 左箭頭 回到上次瀏覽地點

Command + Option + 右箭頭 回到最新的瀏覽地點

Command + B 跳到函數定義處

Command + Shift + B 跳到函數實現處

IDEA 快捷鍵展示(內含動圖演示)

Ctrl + H 查看當前類繼承結構

Ctrl + Shift + H 查看當前方法調用點

Command + U 跳轉到父類/父方法

萬能修復

Option + Enter 根據ide 提示直接修復代碼問題

IDEA 快捷鍵展示(內含動圖演示)


分享到:


相關文章: