AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Visual studio code multiple cursors9/20/2023 ![]() You can find these and many more Visual Studio Code keyboard shortcuts here or in VS Code hit ⌘k then ⌘s. Hold down ⌥⇧ and move your mouse to drag a “selection box” of cursors from your current cursor. ![]() You could also look at Column Selection Mode or Ctrl+Alt+Downarrow (Add cursor below) after putting the cursor on the top line where you want it is probably the easiest. ⌥⇧ + mouseĭon’t tell your VIM friends, but sometimes the mouse truly is the fastest way. For the beginnings, I guess you can just Ctrl+Alt+Down at the beginning to add more cursors. Hit ⌘F to find in file, type in your fancy regex for whatever you’re looking for, and then hit ⌥⏎ to spawn cursors at every match (Pro-tip: ⌘⌥R toggles regex search, and ⌘⌥C toggles case-insensitive search). Sometimes you want to find the next occurrence using regex or a case-insensitive search. Need just a few more cursors? Tap ⌘⌥↑ or ⌘⌥↓ to create cursors above or below the current cursor. An introduction and comprehensive look at multi-cursor editing in VS Code.As the name suggests, multi-cursor lets you create multiple cursors in a file. Select some text, hit ⌘⇧L, and you’ll have a cursor everywhere that your selected text appears in the file. ⌘⇧L is ⌘D for when you know you want to select every occurrence in the file. ⌘D should solve your multi-cursor needs 80% of the time. Keep hitting ⌘D to find more occurrences and spawn cursors all over your giant files with ease. Select some text and hit ⌘D to create a cursor at the next occurrence of that text. I'll show you how to: Create multiple cursors with and without your mouse. For instance, multi-cursors allow you to change values across several CSS lines blazingly fast: Example adapted from the VS Code docs. ⌘D ( Control + D on windows) is the G.O.A.T of multi-cursor editing. You can insert multiple cursors on a single line or across multiple lines and edit multiple places in your code simultaneously. If you’re a VSCode user and yet not familiar with the multi-cursor shortcuts, here’s a quick rundown of what you can do: ⌘D / Control + D VSCode’s (don’t worry, Microsoft is cool now) multi-cursor editing features are a life-saver when it comes to editing these files. It’s everywhere: BOSH manifests, Concourse pipelines, CF application manifests, often huge reams reaching tens of thousands of lines. In the world of Cloud Foundry we often jokingly refer to ourselves as yaml developers.
0 Comments
Read More
Leave a Reply. |