简体   繁体   English

VSCode 拆分编辑器移动文件而不是复制

[英]VSCode split editor move file instead of copy

I have recently moved to Visual Studio Code and have a question that I have found an answer for.我最近转向了 Visual Studio Code,并且有一个问题已找到答案。

When I split the editor it shows the focused file on both sides of the split.当我拆分编辑器时,它会在拆分的两侧显示聚焦文件。

I want the focused file to be moved with the split rather than showing a duplicate view.我希望焦点文件随拆分一起移动,而不是显示重复视图。

Is there a setting or an extension that I can use to do this split / move?是否有可用于执行此拆分/移动的设置或扩展?

Try the Move Editor into next Group command:尝试Move Editor into next Group命令:

{
  "key": "ctrl+cmd+right",
  "command": "workbench.action.moveEditorToNextGroup"
}

on mac default shortcut is:在 mac 上默认快捷方式是:

control+command+ -> or <- arrow;-) control+command+ -> 或 <- 箭头;-)

on Windows , vscode v1.59.0Windows上, vscode v1.59.0

To move file to right side将文件移动到右侧
click on file to focus:单击文件以聚焦:
ctrl + alt + right arrow ctrl + alt +右箭头

To move file to left side将文件移动到左侧
click on file to focus:单击文件以聚焦:
ctrl + alt + left arrow ctrl + alt +向左箭头

Personally, i always used ctrl+enter combination to open the next file in the side editor.就个人而言,我总是使用 ctrl+enter 组合在侧边编辑器中打开下一个文件。 So far, it is the most recommended way that I always use.到目前为止,这是我一直使用的最推荐的方式。

In Ubuntu (20.04) the keybindings are the same as in windows: ctrl + alt + right and ctrl + alt + left however gnome blocks these keybindings.Ubuntu (20.04) 中,键绑定与 Windows 中的相同: ctrl + alt + rightctrl + alt + left但是gnome 阻止了这些键绑定。 In order to liberate them, run the following in the terminal which changes your gnome settings:为了解放他们,在改变你的 gnome 设置的终端中运行以下命令:

gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right "[]"

After that, it should work.之后,它应该可以工作。

See also: Some VSCode Keybindings not working in Ubuntu另请参阅: 某些 VSCode 键绑定在 Ubuntu 中不起作用

And:和:

https://askubuntu.com/questions/1041914/something-blocks-ctrlaltleft-right-arrow-keyboard-combination https://askubuntu.com/questions/1041914/something-blocks-ctrlaltleft-right-arrow-keyboard-combination

https://github.com/microsoft/vscode/issues/6197 https://github.com/microsoft/vscode/issues/6197

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM