Joh*_*ika 85 visual-studio-code
在Windows上使用VSCode时,我可以浏览文件资源管理器并点击Enter焦点文件,文件将在编辑器中打开.但是,在我的Mac上,当我这样做时,VSCode将打开重命名输入,如下所示:
我不确定为什么会这样做.即使在其他文本编辑器(例如Atom)中,默认行为是打开文件Enter.有没有办法改变这种行为,以便打开文件Enter?到目前为止我找到的唯一解决方法是CTRL+ Enter,它在新窗格中打开文件,但在VSCode中有3个窗格限制,这是非常有限的.
Joh*_*ika 158
如果其他人遇到此问题,则在Mac上的VSCode中从文件资源管理器中打开文件的键盘快捷键是:
CMD+Down
这也适用于Finder.
bki*_*idd 16
在版本1.19.2中,在Mac上我可以转到键盘快捷键(菜单栏>代码>首选项>键盘快捷键),搜索"重命名",然后编辑"renameFile"("当"值为"explorerViewletVisible && filesExplorerFocus" &&!inputFocus")将快捷方式更改为"cmd + enter".
您还可以在keybindings.json中找到以下内容(键盘快捷方式页面上有一个指向它的链接):
{
"key": "cmd+enter",
"command": "renameFile",
"when": "explorerViewletVisible && filesExplorerFocus && !inputFocus"
}
Run Code Online (Sandbox Code Playgroud)
Enter现在在资源管理器中打开突出显示的文件,然后按ctrl + enter将其置于重命名/编辑模式.
-编辑-
升级到1.21.0后,回车键再次开始作为renameFile运行.cmd + enter仍然可以作为renameFile运行.要修复此问题,请转到菜单栏>代码>首选项>键盘快捷键,然后右键单击有问题的条目并将其删除,或在keybindings.json中的命令开头添加连字符/减号:
{
"key": "enter",
"command": "-renameFile",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !inputFocus"
}
Run Code Online (Sandbox Code Playgroud)
Mor*_*esh 14
我最终在这里汇总了一些解决方案,以获取以下keybinding.json版本(通过打开Code > Preferences > Keyboard Shortcuts > keybindings.json):
{
"key": "cmd+enter",
"command": "renameFile",
"when": "explorerViewletVisible && filesExplorerFocus"
},
{
"key": "enter",
"command": "-renameFile",
"when": "explorerViewletVisible && filesExplorerFocus"
},
{
"key": "enter",
"command": "list.select",
"when": "listFocus && !inputFocus"
}
Run Code Online (Sandbox Code Playgroud)
Luc*_*sky 12
SPACE:打开但将焦点放在资源管理器上(filesExplorer.openFilePreserveFocus命令)CMD+Down:打开并聚焦已打开的文件(explorer.openAndPassFocus命令)Mik*_*ike 11
所以我也碰到了这个,但我最终使用的键盘快捷键是映射cmd+enter重命名并从中删除renameFile enter.
{
"key": "cmd+enter",
"command": "renameFile",
"when": "explorerViewletVisible && filesExplorerFocus"
},
{
"key": "enter",
"command": "-renameFile",
"when": "explorerViewletVisible && filesExplorerFocus"
}
Run Code Online (Sandbox Code Playgroud)
cmd+down 在Mac 10.10.5上使用VSCode 1.10.2对我不起作用。
但是,cmd+enter确实对我有用。
或者,如果您要设置自己的键绑定以从“文件资源管理器”打开文件,请将这些行添加到您的keybindings.json:
// open file from File Explorer
{ "key": "enter", "command": "list.select",
"when": "explorerViewletVisible && filesExplorerFocus" },
Run Code Online (Sandbox Code Playgroud)
(当然,您可以更改enter为所需的任何组合键)。
| 归档时间: |
|
| 查看次数: |
14373 次 |
| 最近记录: |