您现在的位置: IOS教程網 >> IOS系統 >  >> iOS 程式開發 >> iOS 開發綜合

Mac 版 Android Studio 快捷鍵完整整理

編輯:iOS 開發綜合

把常用操作練成肌肉記憶,是開發效率最直接的來源。以下依功能分類整理 Mac 版 Android Studio 的快捷鍵,方便隨時查閱。

先看符號對照:⌥ = option/alt,⇧ = shift,⌃ = control,⌘ = command,⎋ = esc。

Code:編輯相關

alt + F7             Find usage
alt + command + L    格式化代碼
alt + control + O    優化 import(移除無用的 import)
command + O          Override Methods
command + I          Implement Methods
command + B          查看定義(Declaration)
alt + command + B    查看實現(Implementations)
command + U          Super Method
control + ↑ / ↓      上一個/下一個方法
shift + F2           定位並高亮錯誤(deprecate、unused)
command + Z          撤銷
shift + command + Z  重做
alt + enter          引入套件、補上註解等意圖操作
control + enter      generate setter/getter…
shift + command + T  建立 Test
command + W          擴展選取
shift + command + W  縮小選取
command + P          參數提示
command + Y          刪除當前行
command + X          剪切當前行
command + F11        添加/取消 bookmark
shift + F11          顯示 bookmark 列表
command + + / -      展開/收縮代碼
shift + command + ↑/↓  整行上移/下移

Search:搜尋與定位

command + F               Find
command + R               Replace
control + shift + F       Find in Path
control + shift + R       Replace in Path
alt + command + ← / →     后退/前進
command + E               Recent Files
shift + command + E       Recently Changed Files
shift + shift             Search Everywhere
command + N               Search Class
shift + command + N       Search File
shift + alt + command + N Search Symbol

Run / Debug

shift + F10          Run
shift + F9           Debug
command + F9         Make Project
shift + command + F9 Make Module
command + F2         關閉當前執行的 task
command + F8         添加/取消斷點
shift + command + F8 查看所有斷點

Debug 執行控制:
F7                 Step Into
F8                 Step Over
shift + F8         Step Out
F9                 Resume
alt + F9           Run to Cursor

Refactor:重構

shift + F6        重命名
command + F6      快速修改函式參數、回傳值或類別泛型
F6                Move:移動方法或類別
F5                Copy:複製類別
alt + command + C 提取 Constant
alt + command + V 提取 Variable(區域變數)
alt + command + F 提取 Field
alt + command + M 提取 Method

Window:視窗操作

control + ← / →  切換 tab
alt + F4          關閉當前 tab
esc + command     切換當前視窗
shift + esc       隱藏側欄

VCS:版本控制

command + K         Commit Changes
shift + command + K Push Commit Changes
command + T         Update Project

Setting

command + ,   Android Studio Preferences
command + ;   Project Structure

幾個特別值得練起來的

shift + shift(連按兩下 Shift)是 Search Everywhere,能同時搜檔案、類別、符號與動作,幾乎可以取代大半的選單操作。alt + enter 是意圖修復,紅字報錯時幾乎都能靠它找到正解。alt + command + V 提取區域變數,能把一行冗長的運算式瞬間變得可讀。這三個練熟,收益遠大於背下整張表。

  1. 上一篇文章:
  2. 下一篇文章:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © IOS教程網 All Rights Reserved