掌握快捷键在开发中是非常重要的,能够加快开发速度。这里的快捷键我和eclipse设置相同,因为目前我使用的开发工具有 idea、VScode、HBuilder X快捷键都设置成一样的,开放中就顺利多了。

hbuilder里怎么修改iOS的sdk_快捷键

这里的设置和VScode一样,左边是原有的快捷键,不能更改。将需要更改的快捷键复制到右边,点击保存即可生效。但是如果遇到快捷键冲突的情况会弹出一个框,让你选择。这里选择最下面一项,以后只选择一个,这里就可以选择今后这个快捷键你是使用哪个功能。今后在使用同样的快捷键就不会弹出提示框了。

hbuilder里怎么修改iOS的sdk_ide_02

  • 我设置后的快捷键如下
[
	//重命名文件(焦点在项目管理器中)
	{
		"key": "f2",
		"command": "renameFile"
	},
	//剪切文件(焦点在项目管理器中)
	{
		"key": "ctrl+x",
		"command": "filesExplorer.cut"
	},
	//复制文件(焦点在项目管理器中)
	{
		"key": "ctrl+c",
		"command": "filesExplorer.copy"
	},
	//粘贴文件(焦点在项目管理器中)
	{
		"key": "ctrl+v",
		"command": "filesExplorer.paste"
	},
	//复制
	{
		"key": "ctrl+c",
		"command": "editor.action.clipboardCopyAction"
	},
	//复制文件路径
	{
		"key": "ctrl+shift+alt+c",
		"command": "editor.action.clipboardCopyPathAction"
	},
	//剪切
	{
		"key": "ctrl+x",
		"command": "editor.action.clipboardCutAction"
	},
	//粘贴
	{
		"key": "ctrl+v",
		"command": "editor.action.clipboardPasteAction"
	},
	//撤销
	{
		"key": "ctrl+z",
		"command": "undo"
	},
	//重做
	{
		"key": "ctrl+y",
		"command": "redo"
	},
	{
		"key": "ctrl+shift+z",
		"command": "redo"
	},
	//关闭当前标签卡
	{
		"key": "ctrl+f4",
		"command": "workbench.action.closeActiveEditor"
	},
	//关闭所有标签卡
	{
		"key": "ctrl+shift+f4",
		"command": "workbench.action.closeAllEditors"
	},
	//新建
	{
		"key": "ctrl+n",
		"command": "workbench.action.menu.new"
	},
	//打开外部文件
	{
		"key": "ctrl+o",
		"command": "workbench.action.files.openFile"
	},
	//保存
	{
		"key": "ctrl+s",
		"command": "workbench.action.files.save"
	},
	//全部保存
	{
		"key": "ctrl+shift+s",
		"command": "workbench.action.files.saveAll"
	,"override":true},
	//向下插入行
	{
		"key": "ctrl+enter",
		"command": "editor.action.insertLineAfter"
	},
	//向上插入行
	{
		"key": "ctrl+shift+enter",
		"command": "editor.action.insertLineBefore"
	},
	//上移一行
	{
		"key": "ctrl+up",
		"command": "editor.action.moveLinesUpAction"
	},
	//下移一行
	{
		"key": "ctrl+down",
		"command": "editor.action.moveLinesDownAction"
	},
	//注释/反注释
	{
		"key": "ctrl+/",
		"command": "editor.action.commentLine"
	},
	//块注释
	{
		"key": "ctrl+shift+/",
		"command": "editor.action.blockCommentLine"
	},
	//格式化
	{
		"key": "shift+alt+f",
		"command": "editor.action.format",
		"override": true
	},
	//注释/反注释
	{
		"key": "ctrl+/",
		"command": "editor.action.commentLine"
	},
	//块注释
	{
		"key": "ctrl+shift+/",
		"command": "editor.action.blockCommentLine"
	},
	//运行
	{
		"key": "ctrl+r",
		"command": "app.action.rundevice"
	},
	//重新运行
	{
		"key": "ctrl+f5",
		"command": "workbench.action.debug.restart",
		"when": "isDebugConsoleViewVisible"
	},
	//停止运行
	{
		"key": "ctrl+shift+f5",
		"command": "workbench.action.debug.stop",
		"when": "isRunning"
	}, //光标后退
	{
		"key": "ctrl+q",
		"command": "workbench.action.navigateBack",
		"override": true
	},
	//光标前进
	{
		"key": "alt+right",
		"command": "workbench.action.navigateForward"
	}
]

注意一个问题:在eclipse里面的Ctrl + Q是回到上一次编辑的地方,但是HBuilderX没有提供这个,但是我更换了 alt+left回到上一次光标的位置。我将这个快捷键更换为Ctrl+q,记住:这是回到上一次光标的位置,不是编辑的位置。

有些快捷键HBuilderX里面定义的会更好用写,但是我为了与idea和VScode工具和个人使用习惯达成一致,我还是更改成自己习惯的快捷键。