Xcode快捷键的使用

来源:互联网 发布:90后网络女歌手有哪些 编辑:程序博客网 时间:2024/05/22 14:46

一、关于运行调试
1、运行——Command + R
2、停止——Command + .
3、调试——F6单步调试、F7跳入、F8继续

二、导航
1、切换头文件和.m文件——Command + Control + 上下箭头键
2、回退(回到你上次打开的页面)——Command + Control + 左箭头
3、回到之前打开的页面——Command + Control + 右箭头

三、文件 File
1、新建项目——Command + shift + n
2、新建文件——command + n
3、新建空文件——command + control + n
4、打开——command + o
5、保存——command + s
6、关闭窗口——command + w
7、保存所有文件——command + option + s
8、还原到保存时状态——command + u

四、编辑代码
1、代码缩进
左缩进——command + [
右缩进——command + ]
2、代码编辑
向右一个字符——control + F
向左一个字符——control + B
前一行——control + P
后一行——control + N
去行首——control + A
去行尾——control + E
调换光标两边的字符——control + T
删除光标右侧字符——control + D
删除本行剩余的字符——control + K
3、文档内搜索
搜索——command + F
搜索下一处——command + G
搜索上一处——command + shift + G
4、注释
简单注释——command + /
详细注释——command + option + / (Xcode8开始支持,将光标放在方法上的空白处)
5、折叠代码
Xcode7之后折叠功能默认禁止使用,首先打开折叠代码功能——在Xcode菜单里选择Preference—Text Editing—里面有一个“code folding ribbon”,勾选它就能恢复代码折叠功能。
打开折叠功能之后的相关快捷键:
局部折叠(折叠一个函数)——command + option + 左箭头键
全局折叠(折叠当前文件下的全部函数)——command + option + shift + 左箭头键
折叠注释块(/* */之间的文字)——command + control + shift + 左箭头键
打开折叠部分——将左箭头键改为右箭头键

原创粉丝点击