IDEA快捷鍵完整說明

2022-01-18 08:56:56 字數 4759 閱讀 4696

我在網上看到了不少介紹idea快捷鍵的帖子,但總感覺對其介紹不完整,在這裡我專門翻譯了idea官方的快捷鍵手冊,其中一些翻譯可能不太準確,希望大家見諒。

熱鍵               說明

ctrl + space               簡單的**自動補全,如類名、方法名、變數名等

ctrl + shift + space         根據預估型別,智慧型**補全

ctrl + shift + enter           補全乙個表示式,可自動補全方法的小括號、大括號。(這個快捷鍵非常強大,可以多試試、有驚喜。)

ctrl + p             檢視方法的引數資訊

ctrl + q            快速檢視方法的文件注釋

shift + f1            外部文件描述

ctrl + 游標移到**上方       檢視變數、方法等的簡要資訊

ctrl + f1           顯示當前檔案的錯誤或警告描述

alt + insert             生成setter/getter、hashcode() 、構造方法等**

alt + i             實現抽象方法

ctrl + alt + t          將選中**塊使用 if..else, try..catch, for,synchronized等環繞

ctrl + /              (取消)單行注釋

ctrl + shift + /          (取消)塊注釋

ctrl + w            連續擴張選中的**塊

ctrl + shift + w           連續減少(以前擴張)的**塊

alt + q             檢視上下文資訊

alt + enter          顯示預估意圖和快速修復

ctrl + alt + l          格式化**

ctrl + alt + o         優化匯入的依賴(刪除不必要的依賴)

ctrl + alt + i           自動縮排線

tab / shift + tab         縮排/反縮排

ctrl + x , shift + delete        剪下當前行

ctrl + c , ctrl + insert        複製當前行

ctrl + v , shift + insert      從剪貼簿貼上

ctrl + shift + v         從歷史剪貼簿選擇內容貼上

ctrl + d            重複當前行或選中的**塊

ctrl + y            刪除當前行

ctrl + shift + j            將兩行智慧型合併為一行

ctrl + enter                將當前行智慧型分割成兩行

shift + enter           開始乙個新行

ctrl + shift + u          將選中的內容進行大小寫相互切換

ctrl + shift + ]/[                         將從當前位置至本級**塊的開頭/結束位置之間的內容選中

ctrl + delete/backspace           刪除游標的後/前乙個單詞或空格

ctrl + numpad+/-                     展開/摺疊**塊

ctrl + shift + numpad+            展開所有**塊

ctrl + shift + numpad-             摺疊所有**塊

ctrl + f4                                  關閉當前編輯視窗

熱鍵說明

alt + f7

在所有檔案中查詢引用點

ctrl + f7

在當前檔案中查詢引用點

ctrl + shift + f7

高亮顯示在當前檔案中的引用點

ctrl + alt + f7

顯示在所有檔案中的引用點

熱鍵說明

雙擊shift

搜尋任何地方(對class 、file 、symbol 、action均可搜尋)

ctrl + f

在當前檔案中查詢

f3 / shift + f3

在當前檔案中查詢下/上乙個內容

ctrl + r

在當前檔案中替換內容

ctrl + shift + f

在專案中全域性搜尋(功能最強大的搜尋)

ctrl + shift + r

在專案中全域性替換(比較危險,慎用)

ctrl + shift + s

結構性搜尋(好像沒啥用)

ctrl + shift + m

結構性替換(好像沒啥用)

熱鍵說明

ctrl + alt + j

使用模板**環繞選中的**塊

ctrl + j

在當前位置插入模板**

iter

生成for-each模板**

inst

生成instanceof模板**

itco

生成iterator的for迴圈模板**

itit

生成迭代器iterator的遍歷元素(好像不起作用)

itli

生成list的迭代器遍歷元素的模板**(好像也不起作用)

psf生成public static final靜態常量模板**

thr生成丟擲異常的模板**

熱鍵說明

f5複製當前類的**來建立乙個新類

f6移動當前類到其他位置

alt + delete

安全刪除乙個類、屬性、方法等

shift + f6

重新命名ctrl + f6

修改類或方法的簽名

shift + ctrl + f6

修改全域性/區域性變數的型別(先選中變數的型別)

ctrl + alt + n

將方法內聯

ctrl + alt + m

提取方法

ctrl + alt + v

提取變數

ctrl + alt + f

提取全域性變數

ctrl + alt + c

提取常量

ctrl + alt + p

提取方法的引數

ctrl + shift + alt + p

函式化引數

熱鍵說明

f8單步跳過,跳至下一行**

f7跳入方法體內,檢視實現細節

shift + f7

智慧型跳入,可以看到所有方法的實現細節

alt + shift + f7

強制跳入

shift + f8

跳出當前方法,返回到上一級方法

alt + shift + f8

強制跳出當前方法

alt + f8

計算表示式(可動態地修改執行時變數的值,同樣也可動態檢視變數的值)

f9跳至下乙個斷點位置

alt + f9

跳至游標處

ctrl + f8

斷點狀態切換

ctrl + shift + f8

顯示所有斷點

alt + f10

顯示**當前執行到的位置點

熱鍵說明

ctrl + f9

編譯專案

ctrl + shift + f9

編譯選中的檔案、包或模組

alt + shift + f10/f9

選擇配置並執行/除錯

shift + f10/f9

執行/除錯

ctrl + shift + f10

根據編輯器的上下文配置來執行專案

熱鍵說明

ctrl + k

將所做修改提交(commit)到版本控制系統

ctrl + shift + k

推送本地**至遠端倉庫

ctrl + t

從遠端倉庫來更新本地**

alt + shift + c

顯示最近所做的修改

alt + 反引號(`)

彈出版本控制系統彈窗

ctrl + alt + a

新增檔案到版本控制系統

ctrl + shift+ 反引號(`)

彈出分支(branch)彈窗

ctrl + alt + z

撤消當前檔案在(還未提交)工作空間所做修改

ctrl + d

比較當前檔案被修改前後的差異

熱鍵說明

alt + [0-9]

開啟相應的工具窗

ctrl + s

儲存所有

ctrl + alt + y

**同步

ctrl + shift + f12

編輯器最大化切換

alt + shift + f

新增收藏

alt + shift + i

使用當前配置檔案檢查當前檔案

ctrl + 反引號(`)

快速切換顏色方案、**風格等

ctrl + alt + s

開啟settings彈窗

ctrl + alt + shift + s

開啟專案結構彈窗

ctrl + shift + a

查詢action

ctrl + tab

快速切換各種工具窗和編輯窗

IDEA快捷鍵說明

ctrl win 快捷鍵 介紹ctrl f 在當前檔案進行文字查詢 ctrl r 在當前檔案進行文字替換 ctrl z 撤銷ctrl y 刪除游標所在行 或 刪除選中的行 ctrl d 複製游標所在行 或 複製選擇內容,並把複製內容插入游標位置下面 ctrl w 遞進式選擇 塊。可選中游標所在的單詞...

IDEA 快捷鍵(MAC 版)說明

自 希望這個版本的介紹更加清楚,減少你一些困惑。keymap檔案位置 在os x系統中,快捷鍵配置檔案存在於 library preferences intellij idea keymaps idea中設定快捷鍵位置 設定快捷鍵就是在對應action上點選右鍵,選擇add keyboard sho...

idea快捷鍵 Alt Shift 快捷鍵

alt shift n 選擇 新增 task 必備 alt shift f 顯示新增到收藏夾彈出層 新增到收藏夾 alt shift c 檢視最近操作專案的變化情況列表 alt shift i 檢視專案當前檔案 alt shift f7在 debug 模式下,下一步,進入當前方法體內,如果方法體還有...