![]() You can't see those keypresses as they are captured by the extension and not displayed.Įxtension link: Jump and Select Extension Commands In this demo I trigger the same keybinding ( I used Alt+ D, but it could be anything) on both sets of selections - the first time I press a Space after the keybinding and the second time I press a C. It will only take a single character and doesn't use a regex so it is not nearly as powerful as extension.īut it only requires a single keybinding to go forward and select to any character, for example. I am working on a simplified extension that allows you to jump with/without selecting simply with a keybinding and the character you want to go to. Or, once I somehow manage to get the cursor at the first space I might want to select from there to the first open paren. ![]() In other words I might want to move to the start of the line, then select to the first space in each line. Ideally I'd be nice to do it with or without select. Is there a way to go move all the cursors to forward or back to some specific character?Ĭommon wants would be, next space, next comma, next open or close paren, brace, square bracket, angle bracket, next quote, next double quote, etc. You can come up with a regular expression that will match but that just adds to the tedium. Searching and pressing Ctrl+ Shift+ L can sometimes cover it but not always and further it's tedious (select the area, Ctrl+ F, try to enter some regular expression that only selects the things you want), as you can see above, searching for space will fail. If my cursors are at the beginning of each of those lines how can I get them to be at first space in each line? Next word won't work because it will stop at the dashes. Ctrl+ Left and Ctrl+ Right moves them forward and backward a word I often want to move them all to the next space so aaa-bbb-ccc ddd-eee-fff Pressing Home will move them all to the beginning of the line, and pressing End will move then all to the end. Quite often I want to move all the cursors in VSCode to the next space. With fixing Issue #2106, it is now possible to also remove a cursor by using the same gesture on top of an existing selection.Is there a way to move multiple cursors to the next/prev space (or possibly other character) in VScode? For example, when the setting is ctrl/Cmd, multiple cursors can be added with Ctrl / Cmd + Click, and opening links or going to definition can be invoked with Alt + Click. The Go To Definition and Open Link gestures will also respect this setting and adapt such that they do not conflict. There's also a new menu item Use Ctrl + Click for Multi-Cursor in the Selection menu to quickly toggle this setting. ctrl/Cmd - Maps to Ctrl on Windows and Cmd on macOS.This lets users coming from other editors such as Sublime Text or Atom continue to use the keyboard modifier they are familiar with. VSCode developers have introduced a new setting, editor.multiCursorModifier, to change the modifier key for applying multiple cursors to Cmd + Click on macOS and Ctrl + Click on Windows and Linux. ![]() So, recent versions of VSCode let you toggle between Alt+LeftMouse and Ctrl+LeftMouse under the Selection menu, as detailed in another answer.Īlternately, you could change your OS key bindings using gsettings as mentioned in another answer.Īdd multiple cursors with Ctrl / Cmd + Click Ubuntu) assign window dragging to Alt+LeftMouse, which will conflict with VSCode. This makes it a lot easier to introduce multiple cursors select 300 lines and only 80 fit in the viewport). If the find widget is open, then the find widget settings (matchCase / matchWholeWord) will be used for determining the next occurrenceĬtrl+U ( Cmd+U on Mac) undoes the last cursor action, so if you added a cursor too many or made a mistake, you can press Ctrl+U ( Cmd+U on Mac) to go back to the previous cursor state.Īdding cursor up or down ( Ctrl+Alt+Up / Ctrl+Alt+Down) ( Cmd+Alt+Up / Cmd+Alt+Down on Mac) now reveals the last added cursor to make it easier to work with multiple cursors on more than 1 viewport height at a time (i.e. More multi-cursor features are now available in Visual Studio Code 0.2:Ĭtrl+D ( Cmd+D on Mac) selects next occurrence of word under cursor or of the current selectionĬtrl+K Ctrl+D moves last added cursor to next occurrence of word under cursor or of the current selection This works on Windows and Linux*, and it should work on Mac, too. ![]()
0 Comments
Leave a Reply. |