轉載:iOS開發快捷鍵
作者:指尖書法
鏈接:https://www.jianshu.com/p/8e5c6acb840f
一、快速移動相關
- 代碼移動:
上:command + option + [
下:command + option + ]
左:command + [
右:command + ]代碼上下左右移動
- 快速移動光標到當前整個編輯區域的頂部/底部:
command + ⬆️ / ⬇️
- 將光標移動到所在行的最前面/後面:
command + ⬅️ / ➡️
- 將光標移動到所在單詞的最前面/後面:
option + ⬅️ / ➡️
- 快速跳轉到某一行
command + L
- 返回至上一次光標位置(這個方法太關鍵了)
control + command + ⬅️
control + command + ➡️
- 快速選中
shift + ⬆️⬇️⬅️➡️ 可以根據具體情況選中文本
command + shift + ⬅️、➡️ 選中當前行
- 可以代替箭頭按鍵的功能(雙手不用離開主鍵盤區)
control-B: 向左一個字符(backward)
control-F: 向右一個字符(forward)
control-P: 前一行(previous)
control-N: 後一行(next)
control-A: 行首
control-E: 行尾
control + L : 將光標所在地置於窗口正中
control-T: 調換光標兩邊的字符
control-D: 刪除光標右側的一個字符
control-K: 刪除光標右側的所有字符
command + delete 刪除光標左側的所有字符
option + delete 刪除光標之前的一個單詞(以空格隔開就算一個單詞)
control + delete 刪除光標之前的一個單詞 (駝峯命名法中,每個部分作爲一個單詞)ALT+delete刪除.gif
Control+delete刪除單詞.gif
二、Xcode窗口相關
-
顯示/隱藏左側導航器面板
Command+0 (這是數字0)
Command + 1...8 分別對應不同的左側導航器面板 -
顯示/隱藏實用工具面板
Command+Option+0 (這是數字0)
Command+Option+ 1...4 分別對應不同的右側工具面板左側導航器面板
右側工具面板
-
輔助編輯器
Command + Alt + Enter :打開輔助編輯器:
Command + Enter :關閉輔助編輯器(顯示標準單窗口編輯器)
Command + option + shift + enter : 打開版本編輯器視圖 (source control)
Option+左鍵點擊(左側導航欄文件) :輔助編輯器狀態下快速找到需要連線的文件
Command + option + enter :storyboard中快速打開對應的控制器.h文件 -
搜索與替換
- 全局搜索
Command + Shift + F : 快速打開左側搜索導航器(搜索模式)
Command + Shift + Option + F :快速打開左側搜索導航器(替換模式)
Command + 3 :同上兩個 - 文檔內搜索
Command + F: 搜索
command + E : 使用當前選中內容查找
Command + G: 搜索下一處
Shift + Command + G: 搜索上一處
- Xcode中頁面跳轉
Command + control + F : Xcode 全屏
Command + Shift + 0 (Zero) : 顯示蘋果官方文檔頁面
在類或者方法名上執行Option + Left-click操作 :快速幫助
control + 6 :彈出當前class方法列表
control + 1 :查看方法的調用者
control + 2 、3、4.... :上方菜單欄對應的頁面
command + shift + y:隱藏/打開控制檯:
command + control + ⬆️/⬇️ 快速切換到.m文件/.h文件:
command + shift + J : 快速定位到當前編輯文件的導航區域(左側的文件目錄)
command + shift + O :快速打開某一個文件(快捷搜索、打開文件)
command + , :打開偏好設置
三、關於運行與調試
- 編譯與運行
Command + R 運行。
Command + . 停止
Command + B: 編譯
Command + SHIFT + B 分析代碼,找到潛在內存溢出問題
Command + SHIFT + K: 清理 - 調試模式
Command + shift + Y :調試區視圖打開/關閉
Command + K : 清理 控制檯
Command + shift + C :打開控制檯窗口
Command + \ : 當前行設置/取消斷點
Command + Y 全局激活或禁用斷點
F6 調試時 Step Over
F7 調試時 Step Into
F8 調試時 Step Out
Control + Command + Y : debug斷點時continue
Command + Alt + P : 繼續(在調試中)
Command + Alt + 0 :跳過
Command + Alt + I :跳入 xcode shem管理
Command + Alt + T :跳出
四、文件相關
新建項目 Command +shift+ N
新建文件 Command + N
新建空文件 Command +control+ N
打開 Command + O
關閉窗口 Command +W
保存: Command + S
保存所有文件 Command +option+S
另存爲 : Command + SHIFT + S
Command + Alt + 上方向鍵 :打開配套文件
Command + D :添加書籤
五、代碼相關
command + option + ⬅️ (隱藏代碼塊)
command + option + ➡️(展開代碼塊)
command + control + e (必須光標在一個變量上面):全局修改局部變量快捷鍵
ESC: 自動提示列表
command + /: 註釋或取消註釋
command + option + ? : 爲方法寫整段註釋
雙擊中括號或者大括號:選中相應的一整段封閉代碼塊