admin管理员组文章数量:1516870
实现目标
在获取左侧项目栏文件夹焦点情况下 添加新建文件夹的快捷键 Shift + A
我本来是个atom忠实粉丝, 但是atom使用window10自带输入法在书写汉字时总是会出现首字母缺失的情况, 查了好久没法解决, 直接放弃了atom, 转而使用Vs code书写markdown,
但是使用Vs code时发现在左侧导航栏配置新建文件和文件夹没有快捷方式, 于是就想配置一个, 但是在百度上搜了好长时间, 却总是解决不了KeyBoard Shortcuts上面的when 属性, 最终访问的 Vs code 官方文档 解决的.
下面是官方文档配置快捷键的地址
相应步骤
点击左下角设置图标, 点击其中的选项KeyBoard Shortcuts.
输入 “explorer.new” 找到相应命令, 点击 explorer.newFolder 行配置上 “Shift + A”, 快捷键. 但是这里还有个 When 属性, 如果放任不管的话, 软件会默认全局快捷键, 试想一下, 在你编辑的时候突然按了个 “Shift + A”, 结果新建了个文件夹, 那真是太糟糕了, 所以 When 属性一定要解决.
在KeyBoard Shortcuts视图里, 有一个打开keybindings.json文件的链接, 点击可以打开该文件,
此时我们可以看到右侧文件的相应配置, 这就是我们刚刚配置的东西. 我们可以参照左边的格式配置 when 属性, 可是我们该怎么选择属性呢.找到符合条件的When属性
现在我们可以打开 Vs code 的官方文档 ,这个是国外的网站, 纯英文. 可能打不开, 下面贴上文档里的关于 When 的介绍, 里面也是英文的, 不过作为使用Vs code的开发人员, 这点应该能看懂的, 实在不行也可以google翻译.
Context name True when Editor contexts editorFocusAn editor has focus, either the text or a widget. editorTextFocusThe text in an editor has focus (cursor is blinking). textInputFocusAny editor has focus (regular editor, debug REPL, etc.). inputFocusAny text input area has focus (editors or text boxes). editorHasSelectionText is selected in the editor. editorHasMultipleSelectionsMultiple regions of text are selected (multiple cursors). editorReadonlyThe editor is read only. editorLangIdTrue when the editor’s associated matches. Example: "editorLangId == typescript".isInDiffEditorThe active editor is a difference editor. isInEmbeddedEditorTrue when the focus is inside an embedded editor. Operating system contexts isLinuxTrue when the OS is Linux isMacTrue when the OS is ma
版权声明:本文标题:VSCode秘技:配置新建文件夹快捷键,让代码编辑更高效 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.betaflare.com/web/1772668869a3276367.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论