admin管理员组文章数量:1290263
In VS Code, let's say I have three lines selected:
Is there a way to convert that to a column select?
This would be an extremely handy shortcut for me because I use Space Block Jumper to easily select blocks of text with a single keyboard shortcut, and quite often I find a similar need to edit a block of text column-wise.
In VS Code, let's say I have three lines selected:
Is there a way to convert that to a column select?
This would be an extremely handy shortcut for me because I use Space Block Jumper to easily select blocks of text with a single keyboard shortcut, and quite often I find a similar need to edit a block of text column-wise.
Share Improve this question asked Feb 20 at 9:30 Robert Mark BramRobert Mark Bram 9,75510 gold badges56 silver badges76 bronze badges 2- You can hold shift and alt as you select to select in blocks, is that what you want? – Neil Butcher Commented Feb 20 at 9:34
- Thanks @NeilButcher, I use that already, and it's fine for two or three lines. But I am looking for a way to make it easier to column select ten, twenty lines etc with a single keyboard shortcut. Turning a block select into a column select was one mechanism I hoped for. – Robert Mark Bram Commented Feb 21 at 0:51
2 Answers
Reset to default 1The only solution I know is AltShiftI Add Cursors to Line Ends
, that gives you the cursors but without the selection.
You can then do ShiftHome to select the lines, or just Home to have the cursors at the beginning of each line like in your second screenshot.
Here's what HolyBlackCat suggested as a custom keyboard shortcut, which you can put in keybindings.json:
{
"key": "ctrl+b", // TODO: whatever you want
"command": "runCommands",
"args": { "commands": [
"editor.action.insertCursorAtEndOfEachLineSelected",
"cursorHomeSelect",
"cursorHomeSelect", // add another if you want to go to actual start of line rather than just start of non-whitespace content
]},
"when": "editorTextFocus",
},
本文标签: VS Codecan I turn a block selection into a column selectionStack Overflow
版权声明:本文标题:VS Code - can I turn a block selection into a column selection? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741448212a2379328.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论