Open musjj opened 2 months ago
This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
If you're using multi-cursor with Find Next Occurrence (Ctrl/Cmd + d) then you have this with slightly confusingly named Move Last Selection To Next Find Match (Ctrl/Cmd + k, Ctrl/Cmd + d) and Cursor Undo (Ctrl/Cmd + u).
If you press Ctrl/Cmd + d one too many times, you can press Ctrl/Cmd + u to put your multiple selection back to how it was before you pressed Ctrl/Cmd + d.
If you're pressing Ctrl/Cmd + d but want to undo the selection you just made, make vscode pretend that piece of code doesn't exist and then continue making additional selections, you can press Ctrl/Cmd + k then press Ctrl/Cmd + d.
For example, selecting all chapters except chapter 4:
"course1": {
"overview": "/online-course",
"chapter1": "/online-course/chapter-1", // <- select "chapter"
"chapter2": "/online-course/chapter-2", // <- select "chapter"
"chapter3": "/online-course/chapter-3", // <- select "chapter"
"chapter4": "/online-course/chapter-4", // <- NOT THIS ONE
"chapter5": "/online-course/chapter-5", // <- select "chapter"
"chapter6": "/online-course/chapter-6" // <- select "chapter"
}
chapter-
If you're not using Ctrl/Cmd + d to select items but instead using something like Select All Occurrences Of Next Match (Ctrl/Cmd + Shift + l) and wanting to deselect specific selections without using a mouse because there's too many matches to Ctrl/Cmd + d them all then this makes more sense.
In terms of the use-case for adding this feature (trying to multi-select many things except for specific cases as determined by the user), the use-case is shared by the issue here: https://github.com/microsoft/vscode/issues/212562
Currently, the only way to remove a cursor in a multi-cursor context is to manually Alt+Click using the mouse.
Combined with
editor.action.focusNextCursor
andeditor.action.focusPreviousCursor
, a command to remove the current cursor will allow the user to easily remove any arbitrary cursor with just using the keyboard.