【发布时间】:2017-04-19 17:39:39
【问题描述】:
【问题讨论】:
标签: visual-studio-code keyboard-shortcuts text-editor
【问题讨论】:
标签: visual-studio-code keyboard-shortcuts text-editor
默认情况下,这是 Ctrl + Shift + Alt + 箭头。
如果您想重新绑定它以与 Visual Studio 保持一致,请将其放入您的 keybindings.json:
{
"key": "shift+alt+down",
"command": "cursorColumnSelectDown",
"when": "editorTextFocus"
},
{
"key": "shift+alt+left",
"command": "cursorColumnSelectLeft",
"when": "editorTextFocus"
},
{
"key": "shift+alt+pagedown",
"command": "cursorColumnSelectPageDown",
"when": "editorTextFocus"
},
{
"key": "shift+alt+pageup",
"command": "cursorColumnSelectPageUp",
"when": "editorTextFocus"
},
{
"key": "shift+alt+right",
"command": "cursorColumnSelectRight",
"when": "editorTextFocus"
},
{
"key": "shift+alt+up",
"command": "cursorColumnSelectUp",
"when": "editorTextFocus"
}
这将与复制一行或使用智能选择扩大/缩小的默认功能冲突,因此您可以添加它以将那些交换为需要 Control:
,
{
"key": "ctrl+shift+alt+down",
"command": "editor.action.copyLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+shift+alt+up",
"command": "editor.action.copyLinesUpAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+shift+alt+right",
"command": "editor.action.smartSelect.grow",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+alt+left",
"command": "editor.action.smartSelect.shrink",
"when": "editorTextFocus"
}
【讨论】:
您可以通过多种方式进行列选择,
如您所述,将光标放在第一列第一个单词的开头(左侧)按住 Alt + Shift,然后按住 右箭头选择第一行 (如果之前的组合键不起作用,请尝试 Ctrl + Shift)。按住按键继续按 向下箭头 键选择列。
将光标置于第一列第一个单词的开头(左侧) 按住 Alt + Shift 并反复按 向下箭头 添加更多光标。 (某些版本的 VSCode 也使用 Ctrl+Shift 代替) 添加光标后,通过简单的 Shift + 右箭头
Ctrl+D 选择当前光标下单词的下一次出现。
Ctrl+Shift+L选择所有出现的当前在光标下选定的单词,无论这些单词是在光标的上方还是下方。
【讨论】:
这就是 vscode 对我有用的东西:
Version: 1.39.2 (user setup)
Commit: 6ab598523be7a800d7f3eb4d92d7ab9a66069390
Date: 2019-10-15T15:35:18.241Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.18362
当第 3 步是按右箭头时,它对我不起作用。
【讨论】:
需要安装Visual Studio Keymap:
现在可以通过 Shift + Alt + Arrows 选择列。
【讨论】:
见Column selection like Visual Studio和https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_43.md#column-selection-mode
列选择模式可能会在 v1.43 或很快推出,请参阅上面链接中的演示。这将是Selection 菜单中的一个选项。
最适合使用鼠标,但也可以使用快捷键:
选中此项后,使用鼠标选择将创建一个列 选择和 Shift+箭头键和 Shift+Page Up/Down 键也将 创建列选择。
【讨论】:
我必须做到以下几点:
ctrl+k,ctrl+s。Notebook: Copy Cell <Up/Down> 和Copy Line <Up/Down> 的键绑定。cursorColumnSelect <Up/Down> 的键绑定。When: textInputFocus 的绑定重新分配给Shift+Alt+<arrow keys>。【讨论】: