文章目錄 Mac鍵盤符號 eclipse(MacOS)模式下的快捷鍵 General 通用 Debugging 調試 Search/ Replace 查詢/替換 Editing 編輯 Refactoring 重構 Navigation 導航 Usage Search 使用查詢 VCS/ Local History 版本控制/本地歷史記錄 Live Templates 動態代碼模板 Other 官方文檔上沒有體現
Mac鍵盤符號
圖標介紹 ? Command ? Shift ? Caps Lock ? Option = Alt ? Control ? Enter ? Delete ? Fn + Delete ↑ 上箭頭 ↓ 下箭頭 ← 左箭頭 → 右箭頭 ? Fn + ↑ = Page Up ? Fn + ↓ = Page Down Home Fn + ← End Fn + → ? Tab = 右制表符 ? Shift + Tab = 左制表符 ? Esc = Escape ? 電源開關鍵
eclipse(MacOS)模式下的快捷鍵
General 通用
快捷鍵快捷鍵符號英文名稱功能說明 Command + 0...Command + 9 ?0…?9 Open corresponding tool window 打開相應編號的工具窗口 Command + S ?S Save all 保存所有 Command + Option + Y ??Y Synchronize 同步、刷新 Command + Shift + F12 ??F12 Toggle maximizing editor 切換最大化編輯器 Option + Shift + I ??I Inspect current file with current profile 檢查當前文件與當前的配置文件 無法正常顯示 ?` Quick switch current scheme 快速切換當前的scheme(切換主題、代碼樣式等) Command + , ?, Open Settings dialog 打開IDEA系統設置 Command + ; ?; Open Project Structure dialog 打開項目結構對話框 Command+3 ?3 Find Action 查找動作(可設置相關選項) Control +Tab ?? Edit window switch 編輯窗口標簽和工具窗口之間切換(如果在切換的過程加按上delete,則是關閉對應選中的窗口) Option + Shift + F ??F Add Favorite 添加到收藏夾 Control + Command + F ??F Switch full screen 切換全屏模式,最大化 Command+4 ?+4 隱藏顯示run窗口 Shift+Control+R ??R 運行main方法
Debugging 調試
快捷鍵快捷鍵符號英文名稱功能說明 F6 F6 Step over 進入下一步,如果當前行斷點是一個方法,則不進入當前方法體內 F5 F5 Step into 進入下一步,如果當前行斷點是一個方法,則進入當前方法體內,如果該方法體還有方法,則不會進入該內嵌的方法中 Option + F5 ?F5 Smart step into 智能步入,斷點所在行上有多個方法調用,會彈出進入哪個方法 Option + F7 ?F7 step out 跳出 Command+R ?R Run to cursor 運行到光標處,如果光標前有其他斷點會進入到該斷點,建議改成Option+F9 Command+U ?U Evaluate expression 計算表達式(可以更改變量值使其生效) F8 F8 Resume program 恢復程序運行,如果該斷點下面代碼還有斷點則停在下一個斷點上 Shift+ Command + B ??B Toggle breakpoint 切換斷點(若光標當前行有斷點則取消斷點,沒有則加上斷點) Shift +Command + F8 ??F8 View breakpoints 查看斷點信息
Search/ Replace 查詢/替換
快捷鍵快捷鍵符號英文名稱功能說明 Double Shift Double ? Search everywhere 查詢任何東西 Command + F ?F Find 文件內查找 Command + K ?K Find next 查找模式下,向下查找 Shift + Command + K ??K Find previous 查找模式下,向上查找 Command + R ?R Replace 文件內替換 Control+H ?H Find in files 全局查找(根據路徑),在文件內搜索 Command + Shift+ R ??R Replace in files 全局替換(根據路徑),和系統快捷鍵沖突,改成Shift+R Control+G ?G Select next occurrence 選擇下一個引用 Control+Command+G ??G Select all occurrences 選擇所有引用 Control+G ?G Unselect occurrence 取消選擇引,和上面重復了,奇怪~ Command + Shift + S ??S Search Structurally 查詢結構(Ultimate Edition 版專用,需要在Keymap中設置) Command + Shift + M ??M Replace Structurally 替換結構(Ultimate Edition 版專用,需要在Keymap中設置)
Editing 編輯
快捷鍵快捷鍵符號英文名稱功能說明 Control + Space ?Space Basic code completion 基本的代碼補全(補全任何類、方法、變量),代碼智能提示,因為和切換輸入法快捷鍵沖突,所以基本改成Alt+/ Shift + Option+Space ??Space Smart code completion 智能代碼補全(過濾器方法列表和變量的預期類型 Command + Shift + Enter ??? Complete statement 自動結束代碼,行末自動添加分號 Control+Shift + Space ??Space Parameter info (within method call arguments) 顯示方法的參數信息 F2/Option+click F2/?+click Quick documentation lookup /Quick documentation 顯示當前位置的變量、方法的 Documentation 內容, 快速查看文檔 Shift + F12 ?F2 External Doc 查看外部文檔(在某些代碼上會觸發打開瀏覽器顯示相關文檔) Control+ 鼠標放在代碼上 ?+mouse Brief Info 顯示代碼簡要信息,這個和系統快捷鍵沖突了 Command + F1 ?F1 Show descriptions of error at caret 在錯誤或警告處顯示具體描述信息 Command + N, Control + Enter, Control + N ?N, ??, ?N Generate code… 自動生成代碼(getter、setter、構造函數、hashCode/equals,toString) Control + O ?O Override methods 覆蓋方法(重寫父類方法) Control + I ?I Implement methods 實現方法(實現接口中的方法) Option + Command + Z ??Z Surround?with… 包圍代碼(使用if…else, try…catch, for, synchronized等包圍選中的代碼) Command+/ ?/ Comment/uncomment with line comment 單行注釋 Command + Option + / ??/ Comment/uncomment with block comment 塊注釋,多行注釋 Shift + Control + / ??/ Comment/uncomment with block comment 塊注釋,多行注釋 /** + enter /** ? Comment with method/class 方法/類的說明注釋 Shift +Control+ 方向鍵上 ??↑ Extend selection 連續選中代碼塊 Shift +Control+ 方向鍵下 ??↓ Shrink selection 減少當前選中的代碼塊 Control + Shift + Q ??Q Context info 顯示上下文信息 Option + Enter ?? Show intention actions and quick-fixes 顯示意向動作和快速修復代碼,無此動作 Shift+Command +F ??F Reformat code 格式化代碼 Shift+ Command+ O ??O Optimize imports 優化import Command+ I ?I Auto-indent line(s) 自動縮進線 Tab / Shift + Tab ? / ?? Indent/unindent selected lines 縮進代碼 / 反縮進代碼 Command + X ?X Cut current line to clipboard 剪切當前行或選定的塊到剪貼板 Command + C ?C Copy current line to clipboard 復制當前行或選定的塊到剪貼板 Command + V ?V Paste from clipboard 從剪貼板粘貼 Command + Shift + V ??V Paste from recent buffers… 從最近的緩沖區粘貼 Option+Command+↓ ? ?↓ Duplicate current line 復制光標所在行的內容,插入光標所在行下面 Command + D ?D Delete line at caret 刪除當前行或選定的塊的行,刪除光標所在行 Control + Shift + J ??J Smart line join 智能的將代碼拼接成一行 Command + Enter ?? Smart line split 智能的拆分拼接的行 Shift + Enter ?? Start new line 開始新的一行,光標所在行下方插入空白行 Option+Command+enter ??? 光標所在行上方插入空白行 Option+Command +→ /Command+F6 ??→/?F6 select next tab 選擇下個tab,使用F6需要配合FN才行 Option+Command +←Shift+Command+F6 ??←/Shift?F6 select previous tab 選擇上一個tab Command + Shift + ] / Command + Shift + [ Select till code block end/ start 選擇直到代碼塊結束/開始,不存在此快捷鍵 Command+ Fn + Delete (?鍵為Fn+Delete)? ? Delete to word end 刪除到單詞的末尾 Command + Delete ?? Delete to word start 刪除到單詞的開頭 Command + 加號 / Command + 減號 ?+ / ?- Expand/collapse code block 展開 / 折疊代碼塊 Command + Shift + 加號 ??+ Expand all 展開所有代碼塊 Command + Shift + 減號 ??- Collapse all 折疊所有代碼塊 Command + W ?W Close active editor tab 關閉活動的編輯器選項卡 Option+上下箭頭 ? +上下箭頭 Move current line of code 移動當前代碼行 Option+enter ? ? 導入包,自動修正代碼,可以自動補齊代碼語句 Shift+Option+enter ?? ? 導入包,自動修正代碼 Option+→ ?→ move to next word 移到下一個單詞 Option+← ?← move to previous word 移到上一個單詞 Command+delete ?? 刪除光標前面的單詞 Command+→ ?→ 移到行尾 Command+← ?← 移到行首 Command+Shift+→ ??→ 選中當前位置到行尾 Command+Shift+← ??← 選中當前位置到行首 Shift+Command+X 選中部分全部大小寫切換 sout System.out.println() fori for (int i = 0; i < ; i++) {}
Refactoring 重構
快捷鍵快捷鍵符號英文名稱功能說明 F5 Copy 復制文件到指定目錄,改成Option+C Option+Command+V ??V Move 移動文件到指定目錄 Option+Shift+Enter ??? Safe Delete 安全刪除 Shift+F6 ?F6 Rename 重命名 Control+T ?T Refactor this 重構這個 Option+Command + C ??C Change Signature 更改簽名,改成Option+Command+S Option + Command + I ??I Inline 一致性 Option + Command + M ??M Extract Method 將選中的代碼提取為方法,選中部分抽取為方法 Option +Command + L ??L Introduce Variable 引入變量 Option +Command + F ??F Introdue Field 引入字段 Command + Option + C ??C Introduce Constant 提取常量 Command + Option + P ??P Introduce Parameter 提取參數
Navigation 導航
快捷鍵快捷鍵符號英文名稱功能說明 Shift+Command + T ??T Go to class 查找類文件 Shift + Command + R ??R Go to file 查找所有類型文件、打開文件、打開目錄,打開目錄需要在輸入的內容前面或后面加一個斜杠 / Command + Option + O ??O Go to symbol 前往指定的變量 / 方法,選中方法名或者變量,查找方法或者變量 Control + 方向鍵左 / Control + 方向鍵右 ?← / ?→ Go to next/previous editor tab 左右切換打開的編輯tab頁,這個快捷鍵不對 F12 Go back to previous tool window 返回到前一個工具窗口 Esc ? Go to editor (from tool window) / focus editor 從工具窗口進入代碼文件窗口 Shift + Esc ?? Hide active or last active tool window 隱藏當前或最后一個活動的窗口,且光標進入代碼文件窗口 Command + L ?L Go to line 在當前文件跳轉到某一行的指定處,跳轉到指定的行 Command + Shift + F4 ??F4 未知 關閉活動run/messages/find/… tab Command + E ?E Recent files popup 顯示最近打開的文件記錄列表 Command + [ / Command + ] ?[/ ?] Navigate back/ forward 退回 / 前進到上一個操作的地方 Command + Shift + Delete ??? Navigate to last edit location 跳轉到最后一個編輯的地方 Option + Command+W ??W Select current file or symbol in any view /select in… 顯示當前文件選擇目標彈出層,彈出層中有很多目標可以進行選擇(如在代碼編輯窗口可以選擇顯示該文件的Finder) F3 / Control + 鼠標點擊 ?B / ? +click Go to declaration 進入光標所在的方法/變量的聲明處 Command + Option + B ??B Go to implementation(s) 選擇方法名,跳轉到實現處,在某個調用的方法名上使用會跳到具體的實現處,可以跳過接口,改成Control+Option+I Option + Space, Command + Y ? Space, ?Y Open quick definition lookup /quick definition 快速打開光標所在方法、類的定義 Control + Shift + B ??B Go to type declaration 選中類名,跳轉到類型聲明處 Command + U ?U Go to Super Method 前往當前光標所在方法的父類的方法 / 接口定義 Control + Option+方向鍵下 / Control + Option+方向鍵上 ??↓ / ??↑ previous/next method 當前光標跳轉到當前文件的前一個/后一個方法名位置,跳到下一個/上一個成員函數或成員變量 Control + ] / Control+Shift+P ?]/??P Move Caret to code block end 移動光標到當前所在代碼塊的結束位置,即跳轉到最近的大括號位置 Option+Command+[ ? ?[ Move Caret to code block start 移動光標到當前所在代碼塊的開始位置 Command + O ?O File structure popup 彈出當前文件結構層,可以在彈出的層上直接輸入進行篩選(可用于搜索類中的方法), 查看當前類成員信息 F4 F4 Type hierarchy 顯示當前類的層次結構 Command + Shift + H ??H Method hierarchy 顯示方法層次結構 Control + Option + H ??H Call hierarchy 顯示調用層次結構 Shift+Command+. ??. previous highlighted error 跳轉到上一個突出錯誤或警告的位置 Shift+Command+ G ??G 查找引用 Command+. ?. Next highlighted error 跳轉到下一個突出錯誤或警告的位置,查看代碼警告 F3 F3 Edit source/View source /jump to source 編輯/查看代碼源 Option + Home ? Home Show navigation bar 顯示到當前文件的導航條 F9 Toggle bookmark 選中文件/文件夾/代碼行,添加/取消書簽 Option + F3 ?F3 Toggle bookmark with mnemonic 選中文件/文件夾/代碼行,使用助記符添加/取消書簽 Control + 0...Control + 9 ?0…?9 Go to numbered bookmark 定位到對應數值的書簽位置 Command + F3 ?F3 Show bookmarks 顯示所有書簽
Usage Search 使用查詢
快捷鍵快捷鍵符號英文名稱功能說明 Shift+Command+G ??G Find usages 在類中查找用法 Shift+Command+U ??U Find usages in file 在文件中查找用法 Command + Shift + F7 ??F7 Highlight usages in file 在文件中突出顯示的用法 Command + Option + F7 ??F7 Show usages 顯示用法 Command+Shift+I ??I 查看定義的類,快速查看
VCS/ Local History 版本控制/本地歷史記錄
快捷鍵快捷鍵符號英文名稱功能說明 Command + K ?K Commit project to VCS/Commit 提交代碼到版本控制器 Command + T ?T Update project from VCS 從版本控制器更新代碼 Option+Command+K ??K Push commits 推送提交 Control + V ?V ‘VCS’ quick popup/VCS Operations “VCS”快速彈出窗口 Option + Shift + C ??C Recent Changes 查看最近的變更記錄 Control + C ?C ‘VCS’ quick popup 快速彈出版本控制器操作面板,沒有此動作
Live Templates 動態代碼模板
快捷鍵快捷鍵符號英文名稱功能說明 Option +Command + Z ??Z Surround with Live Template 彈出模板選擇窗口,將選定的代碼使用動態模板包住,就是添加if/else,try/catch等塊 Command + J ?J Insert Live Template 插入自定義動態代碼模板
Other 官方文檔上沒有體現
快捷鍵快捷鍵符號英文名稱功能說明 Command + Shift +8 ??8 column selection mode 豎編輯模式
說明:刪除線的快捷鍵表示軟件默認沒有此快捷鍵,你需要自己去設置
忠告:開發工具適合自己的就可以了,你熟悉使用eclipse就使用eclipse,你熟悉使用idea就使用idea,如果你希望使用idea又使用eclipse,又不想記住兩套快捷鍵這是不可能的,通過對比發現在idea中使用eclipse(MacOS)的快捷鍵,很多地方需要自定義且和eclipse for Mac默認的快捷鍵也有很多地方不同,所以使用idea的同學建議記住MacOS模式下的快捷鍵為佳!
總結
以上是生活随笔 為你收集整理的IntelliJ IDEA for Mac 在eclipse(MacOS)模式下的快捷键 的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔 網站內容還不錯,歡迎將生活随笔 推薦給好友。