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>


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