某些 VSCode 键绑定在 Ubuntu 中不起作用

kpg*_*kpg 15 ubuntu visual-studio-code

我刚刚开始在 Ubuntu 上使用 VSCode,并正在寻找cmd+shift+DMac 上 Sublime 中的等效项(重复选定的文本)。根据文档,我应该使用Ctrl+Shift+Alt+DownCtrl+Shift+Alt+Up,但这些键绑定对我不起作用。当我查看时File > Preferences > Keyboard Shortcuts,我看到了定义,但是当我尝试使用它们时,什么也没有发生。

Adr*_*ias 14

Ubuntu 使用这些快捷方式来管理工作区。

您可以在“设置”->“键盘”->“查看和自定义快捷方式”中查找这些按键绑定

如果没有设置任何内容Ctrl+Shift+Alt+*,您可以检查gsettings

以下命令应该找到与Up按键组合绑定的快捷方式:

gsettings list-recursively | grep Up
Run Code Online (Sandbox Code Playgroud)

就我而言,有一些会干扰 VS Code:

org.gnome.desktop.wm.keybindings move-to-workspace-up ['<Control><Shift><Alt>Up']
org.gnome.desktop.wm.keybindings switch-to-workspace-up ['<Control><Alt>Up']
Run Code Online (Sandbox Code Playgroud)

钥匙也是如此Down

毕竟,您可以通过以下命令取消设置它们:

gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-up "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-down "[]"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-up "[]"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-down "[]"
Run Code Online (Sandbox Code Playgroud)

如果您想将它们重置回默认值:

gsettings reset org.gnome.desktop.wm.keybindings switch-to-workspace-up
gsettings reset org.gnome.desktop.wm.keybindings switch-to-workspace-down
gsettings reset org.gnome.desktop.wm.keybindings move-to-workspace-up
gsettings reset org.gnome.desktop.wm.keybindings move-to-workspace-down
Run Code Online (Sandbox Code Playgroud)


raj*_*iya 4

在检查我的默认键绑定时,我发现editor.action.insertCursorAboveeditor.action.insertCursorDown每个都有两个键绑定 ctrl+shift+up/downalt+shift+up/down

所以我将editor.action.copyLinesDownActioneditor.action.copyLinesUpAction分别更改为ctrl+shift+upctrl+shift+down。因为在我的 ubuntu 系统中ctrl+shift+alt+up/down按键可以切换工作区。