androidstudio常用快捷鍵
雖說常用然則有部分是不常用的
快捷鍵 | 說明 | |
---|---|---|
F2 | Next Highlighted Error | 定位到錯誤或警告,Shift+F2反向 |
Alt+Enter | Show Intention Actions | 修復錯誤 |
Ctrl+W | Extend Selection | 選中單詞,w按多次會擴大選中範圍 |
Ctrl+Alt+ left/right | Back / Forward | 返回至上次瀏覽的位置 |
Ctrl+Shift+Up/Down | Move Statement Up/Down | 代碼向上/下移動 |
Alt+left/right | Move Caret to Previous/Next Word | 切換代碼視圖 |
Alt+Up/Down | Previous/Next Method | 在方法間快速移動定位 |
Ctrl+Up/Down | Scroll Up/Down | 光標位置不變上下滾動,類似鼠標滾輪 |
Ctrl+N | Navigate/Class | 查找類文件 |
Ctrl+Shift+N | Navigate/File | 查找文件 |
Ctrl+Alt+Shift+N | Symbol… | 快速打開輸入的方法或變量 |
Alt+F3 | Find | 查找相同文本,連續按F3,並高亮顯示 |
Ctrl+Shift+F7 | Highlight Usages in File | 高亮選中文本,Esc取消 |
Ctrl+Shift+Space | SmartType | 自動補全代碼(本人由於輸入法衝突將‘space’改爲‘,’逗號了) |
Alt+Insert | Code Generate | 生成代碼(如get,set方法,構造函數等) |
Ctrl+Shift+Alt+L | Reformat Code | 格式化代碼 |
Ctrl+Shift+F | Find in Path | 全路徑查找 |
Ctrl+P | Parameter Info | 查看參數信息 |
Ctrl+Alt+O | Optimize Imports | 優化導入的類和包 |
Ctrl+Q | Quick Documentation | 把光標移至方法處,按此組合鍵可快速查看方法的說明文檔 |
Ctrl+H | Type Hierarchy | 顯示類結構圖,如繼承、實現關係 |
Ctrl+B | Declaration | 跳轉到類、方法、變量聲明處。與[Ctrl+mouseleft]一樣,[F4]也行 |
Ctrl+Shift+U | Toggle Case | 大小寫轉換 |
Ctrl+U | Super method | 跳到父類 |
Ctrl+E | Recent Files | 查看最近打開打開過的文件 |
Shift+F6 | Rename | 可對類、方法、變量進行重命名 |
Ctrl+F7 | Find Usages in File | 可以查詢當前元素在當前文件中的引用,按F3向前選擇Shift+F3向後 |
Ctrl+Alt+B | Implementation(s) | 查詢光標處的接口/抽象類有哪些實現/繼承 |
Alt+F7 | Find Usages | 查看引用位置 |
Ctrl+Shift+Backspace | Last Edit Location | 跳轉到上次編輯的地方 |
Ctrl+Alt+F7 | Show Usages | 查看一個類、方法、成員變量在整個工程中的使用情況 |
Ctrl+O | override Methods | 重寫父類的方法。接口對應的組合鍵時Ctrl+I |
Ctrl+F12 | Find Structure | 查看當前類結構,成員方法、成員變量 |
Ctrl+Y | Delete Line command + delete | 刪除行 |
Ctrl+D | Duplicate Line or Selection | 複製行或者選擇的代碼 |
Ctrl+X | Cut | 剪切行 |
Ctrl+/ | Comment with Line Comment | 註釋代碼,選擇多行時可同時註釋多行 |
Ctrl+Shift+/ | Code/Comment | 以“/* */”方式註釋 |
Ctrl+[,],{,} | Move Caret To Code Block | 可以跳到符號位置 |
Ctrl+Shift+I | Quick Definition | 查看方法體 |
Ctrl+Alt+V | Extract Variable | 提取變量 |
Ctrl+Alt+M | Extract Method | 提取方法 |
Ctrl+Alt+F | Extract Field | 抽取字段 |
Ctrl+Alt+C | Extract Constant | 抽取常量 |
Ctrl+Alt+P | Extract Parameter | 抽取參數 |
Ctrl+Shift+Insert | Paste from History | 可以選擇剪貼板內容並插入 |
Ctrl+Alt+T | surround with | 快速編碼,比如if,do-while,try-catch等結構 |
Ctrl+Alt+J | surround with Live Template | 用代碼模板包裹代碼 |
Ctrl+Shift+Up/Down | Move Statement Up/Down | 上下移動代碼 |
Alt+Shift+Up | Move Line Up | 向上移動一行 |
Alt+Shift+Down | Move Line Down | 向下移動一行 |
Ctrl+J | Insert Live Template | 自動代碼 |
Ctrl+Shift+C | Copy Paths | 拷貝文件路徑 |
Ctrl+Shift+減號/加號 | Collapse/Expand All | 窗口內所有代碼摺疊/展開 |
Ctrl+G | Navigate/Line | 定位到行 |
Ctrl+減號/加號 | Collapse/Expand | 代碼摺疊/展開,[Ctrl+大於號]也可以實現摺疊/展開 |
F11 | Toggle Bookmark | 添加/刪除書籤,[Ctrl+F11]可用文字標記 |
Shift+F11 | Show Bookmarks | 顯示書籤 |
! | 在自動匹配下拉列表中,up/down選中一個boolean變量,按!後,會在選擇的結果前加上! | |
Shift+MouseWheel | 編輯界面的橫向滾動 | |
Shift+Click | 關閉當前打開的文件 |