Xcode中的快捷鍵總結

有些大招我還沒領教過,等領教了我再補充上來

隱藏xcode command+h
退出xcode command+q
關閉窗口 command+w
關閉所有窗口 command+option+w
關閉當前項目 command+control+w
關閉當前文件 command+shift+w
保存文件 command+s
保存所有文件 command+option+s
還原到保存時狀態 command+u

項目中查找 command+shift+F
查找下一個 command+g
查找上一個 command+shift+g

瀏覽源文件 command+Double Click 
打開頭文件 command+shift+d 
切換頭/源文件 command+option+上箭頭


撤銷 command+z
重複 command+shift+z
剪切 command+x
複製 command+c
粘貼 command+v
粘貼並匹配格式 command+option+shift+v
全選 command+a

註釋 command+/
文件首行 command+上箭頭
文件末 command+下箭頭
行首 command+左箭頭
行末 command+右箭頭
上一單詞 option+左箭頭
下一單詞 option+右箭頭
上一拆分單詞 control+左箭頭
下一拆分單詞 control+右箭頭
下個Build警告或錯誤 command+=
前個Build警告或錯誤 command+shift+=
以調試方式運行程序 command+y
繼續(在調試中)command+option+p
編譯運行 command+r
<span style="font-family: Arial, Helvetica, sans-serif;">Xcode 代碼格式化/自動排版:</span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, STheiti, 微軟雅黑, 黑體, Arial, Tahoma, sans-serif, serif; font-size: 14px;">options+command+ 左右箭頭摺疊/展開 </span>
</span>

Xcode  版本:4.2和4.2之前的版本
             選中需要格式化代碼 -> Edit -> Format ->Re-Indent
Xcode 版本:4.2之後的版本
             選中需要格式化代碼 -> Editor -> Structure ->Re-Indent 或者
             選中需要格式化代碼 -> 右擊 ->選中 Structure ->Re-Indent
<p style="margin: 10px auto; color: rgb(75, 75, 75); font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px;"><span style="line-height: 19.5px;"> esc  顯示代碼提示菜單, 作用和VS中的ctrl+j類似,像 Eclipse 的 alt+/
</span><span style="line-height: 19.5px;"> command + /                 註釋代碼和反註釋,用 //,相當於 Eclipse 的 ctrl+/</span>
<span style="line-height: 19.5px;"> control + command + 上/下箭頭  快速在頭文件(.h)和實現文件(.m)之間切換</span>
<span style="line-height: 19.5px;"> command + b             編譯程序,不運行</span>
<span style="line-height: 19.5px;"> command + r        編譯並運行程序</span>
<span style="line-height: 19.5px;"> command + shift + b         分析代碼,找到潛在內存溢出問題<img title="More..." src="http://unmi.cc/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" style="border: 0px; max-width: 900px;" /></span>
<span style="line-height: 19.5px;"> command  + 單擊         跳轉到聲明</span>
<span style="line-height: 19.5px;"> option + 單擊             彈出層中顯示幫助信息</span>
<span style="line-height: 19.5px;"> option + command + 左/右 方向鍵,摺疊/打開當前方法</span>
<span style="line-height: 19.5px;">  control + command + f           Xcode 全屏,在 Lion 上支持</span>
<span style="line-height: 19.5px;"> command + shit + y             打開/關閉控制檯窗口</span>
<span style="line-height: 19.5px;"> control + k              清理控制檯</span>
<span style="line-height: 19.5px;"> control + command + 左/右方向鍵,在歷史的上/下一個文件中切換</span>
<span style="line-height: 19.5px;">      或用兩個手指左右滑動</span></p><p style="margin: 10px auto; color: rgb(75, 75, 75); font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px;"><span style="line-height: 19.5px;">command 代替 PC 鍵盤上的許多操作,像 Ctrl+V, Ctrl+C, Ctrl+Z,都該用 cmd+V, Cmd+C, Cmd+Z</span></p><p style="margin: 10px auto; color: rgb(75, 75, 75); font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px;"><span style="line-height: 19.5px;"> tab          接受當前的自動完成</span>
<span style="line-height: 19.5px;"> 雙擊中括號或者大括號,可以選擇相應的封閉語句塊</span></p><p style="margin: 10px auto; color: rgb(75, 75, 75); font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px;"><span style="line-height: 19.5px;"> command - shift - o: 快速搜索打開文件</span>
<span style="line-height: 19.5px;"> control 配合 1/2/3/4/5/6 鍵 : 可以快速打開相關文件/類或代碼,我常用 control+1 顯示打開的文件,control+6 顯示當前類中的變量或方法,都可以輸入來過濾</span></p><p style="margin: 10px auto; color: rgb(75, 75, 75); font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px;"><span style="line-height: 19.5px;">command 配合 1/2/3/4/5/6/7 依次顯示左邊導航中每一個標籤的子視圖,commandco+ 0 打開或關閉左邊導航</span></p><p style="margin: 10px auto; color: rgb(75, 75, 75); font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px;"><span style="line-height: 19.5px;"> option + command 配合 1/2/3/4/5/6 依次打開右邊屬性窗口的每一個標籤視圖,特別是在 xib 時 常用,用 option + command + 0 關閉右邊屬性窗口</span></p><p style="margin: 10px auto; color: rgb(75, 75, 75); font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px;"><span style="line-height: 19.5px;"> command + shift + j 在左邊導航中定位當前打開的文件</span>
<span style="line-height: 19.5px;"> command + return 切換到標準編輯器</span>
<span style="line-height: 19.5px;">  option + command + return 切換到輔助編輯器,左右可以對比,特別方便編輯 xib 時進行拖拉關聯</span></p><p style="margin: 10px auto; color: rgb(75, 75, 75); font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px;"><span style="line-height: 19.5px;"> command+shift+f        進行 Search</span>
<span style="line-height: 19.5px;"> f7            調試時 Step Into</span>
<span style="line-height: 19.5px;"> f6            調試時 Step Over</span>
<span style="line-height: 19.5px;"> f8            調試時 Step Out</span>
<span style="line-height: 19.5px;">control + command + y : debug斷點時continue</span></p><p style="margin: 10px auto; color: rgb(75, 75, 75); font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px;"><span style="line-height: 19.5px;"> command + \  : 當前行設置/取消斷點</span>
<span style="line-height: 19.5px;"> command + y  全局激活或禁用所有的斷點</span></p><p style="margin: 10px auto; color: rgb(75, 75, 75); font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px;"><span style="line-height: 19.5px;"> command+ 左/右方向鍵 跳到行首/行尾</span>
<span style="line-height: 19.5px;">option + 左/右方向鍵 向前/後跳一個單詞</span>
<span style="line-height: 19.5px;"> option + delete 向前刪除一個單詞</span>
<span style="line-height: 19.5px;">fn + option + delete 向後刪除一個單詞</span>
<span style="line-height: 19.5px;">command + delete 刪除當前行中光標前所有字符</span>
<span style="line-height: 19.5px;"> fn + command + delete 刪除當前行中光標後所有字符</span></p><p style="margin: 10px auto; color: rgb(75, 75, 75); font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px;">control + /   :   切換到下一個佔位符(自動完成的時候)</p><p style="margin: 10px auto; color: rgb(75, 75, 75); font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px;">control + .   :   下一個自動完成提示</p><p style="margin: 10px auto; color: rgb(75, 75, 75); font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px;">command + e   :   使用當前選中內容查找
command + g   :   在當前文件中查找下一個
command- + shift + f   :   在項目中查找
command + option + shift +t   :   在Groups&Files裏定位到當前編輯的文件</p><p style="margin: 10px auto; color: rgb(75, 75, 75); font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px;">. control+ a  :  光標跳轉到行首
. control +e   :  光標跳轉到行尾
. command+ g   : 向下查找
. command+shift+g   : 向上查找</p>


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章