visual-studio-code - 创建一个快捷方式来切换 VSCode 中的大纲视图
问题描述
我已经成功地为显示大纲面板的 outline.focus 创建了一个快捷键。我正在寻找切换行为。
现有:
{
"key": "ctrl+alt+o",
"command": "outline.focus",
"when": "editorTextFocus"
}
可能吗??
解决方案
这会将焦点切换到大纲视图并折叠大纲视图中所有打开的树项目。
[方便的选项:选项视图中的“跟随光标”选项(单击...
选项)。]
{
"key": "ctrl+alt+o",
"command": "list.collapseAll", // Ctrl+LeftArrow also does this
// Space will open the current tree item
// left/right arrows will open/close item
"when": "outline.active"
},
{
"key": "ctrl+alt+o",
"command": "outline.focus",
"when": "editorTextFocus"
},
因此,单击Ctrl+ Alt+O一次会将焦点转移到大纲视图,然后单击Ctrl+ Alt+O次会折叠所有打开的项目。由于某种原因没有list.expandAll
命令,因此您无法切换它们。
如果您愿意,可以将这些组合成一个宏命令,因此只需点击一个组合键即可聚焦大纲视图并全部折叠。如果你想看,请告诉我。
推荐阅读
- c# - 如何将数据绑定到字符串而不是标签?
- java - FizzBuzz 问题不起作用:java 实现
- kotlin - 抛出异常时 init 块中的“属性必须被初始化或抽象”
- .net - OracleConfiguration.TnsAdmin 不工作?
- reporting-services - SSRS - 在数据集中工作的“度量”字段,但不会出现在报告中
- javascript - JavaScript:向 Array.prototype 对象添加方法以从输入数组中排除索引值
- r - 子集以在单个列中仅输出某些 CHAR 名称
- typescript - 为什么在这种情况下总是返回 true 条件类型不进行类型检查
- google-apps-script - 将单元格值插入此 Google 应用脚本代码以进行导入不起作用
- windows - 如何从命令行向 uwp 应用程序发送参数