So I would say the moving around thing I have internalized and I'm trying to remember that adding shift gives, it is stamping that all over the place. If I add shift to that and hit down I'm copying this line. So here is how I like to remember it, if I hold down option, I can use the up and down arrows to move this line wherever I wanna move it. Like there are people who you could steal their mouse for a day and they wouldn't even notice, I am not one of those people. Most of it is not stuff that I would end up using. All right, so line manipulation and this is a subset but I feel like it's the attainable subset for line manipulation. It 'd be really nice to bring it all at once. You can also select all lines in a column to edit many rows of data at the same time. And in this case that particular term is probably used 30 times in this file. It allows you to highlight a word, then automatically edit all instances of that word in your file. > Mike: Well, sorry I messed it up there, but effectively we were able to grab everything and then get rid of this one and that one there. > Mike: Select everything and then we on click. Control command g, so I could say get everything but remove just that one there. I know the topic of multi cursors-editing in visual studio code is duplicate but what I want is the way (by keyboard) to select word occurrences in just one line in visual studio code, because the other option: ctrl + F2 it selects all the occurrences in all the file, and not the mouse way by holding alt and click. So you could select everything, like we could do this what was it, I haven't internalized this one yet. And I alt click on this, it'll actually get rid of the selection as well not just the cursor which is exactly what we would want in this case. And it appears to also work with like if we have that multi selection going on here. And I will update this that option click also remove a cursor if you click on that exact cursor. The values are preserved on a per cursor basis. It kind of remembers that each cursor gets to hold onto it’s own value, and then when you paste it out it goes. So while I would go back here and type like li and everyone gets the same thing, I can actually grab all of this, cut it move my cursor into the middle and paste. It's almost like each cursor get to do in a little slot and a clip board. Select them, one of the cool things about multi-cursor support and this works as it does in other browsers. So I could just drag a line of cursors here. > Mike: Like one, two, three, it looks I already did example last night. Really nice for Like if you wanted to grab a bunch of HTML elements and like embed them, or you have a list of items. Alt+Shift and then you can drag up and over like this. > Mike: Sorry it is fooling me by highlighting in kind items. And that let's us do something like this. The way I remember this is, it's multi cursor with Shift. It was just placing cursors, right? If we alt click, it's just those individual positions. Option and click is how we got those little cursors and without the Cmd+D thing. There is also more in-depth key bindings documentation HERE.> Mike: So we talked about multi cursor. The default keymap can be found in PDF form HERE, or you can go to File > Preferences > Keyboard Shortcuts to find/modify the current bindings. You can check by searching for in the extensions pane, going to File > Preferences > Keymaps ( CTRL+K CTRL+M). This means that for extremely large files, it may be better to script your edits, rather than doing it manually.įor those like that had to use shortcuts like CTRL + SHIFT + L (default binding is Select all occurrences of current selection) to accomplish this, you should check that you don't have a keymap extension installed. What I accidentally discovered though, (and hasn't been mentioned here yet) is that there is a limit of 10k lines in "cursor edit mode" (there's an open Github feature request to increase it). SHIFT selecting the area you want to column edit, then pressing SHIFT + ALT + i is the most efficient way to handle this. Most of the other keyboard shortcuts mentioned are only useful for a limited number of line. The solution from of using SHIFT + ALT + i worked for me, when I needed to quickly edit ~20k lines in a file. Official VS Code Keyboard shortcut cheat sheets: You can view and edit keyboard shortcuts via: Or, as Isidor Nikolic points out, you can hold Alt and left click to place cursors arbitrarily. If you experience this issue, you can either disable the Intel/other software hotkeys, or modify the VS Code shortcuts (described below). Note that third-party software may interfere with these shortcuts, preventing them from working as intended (particularly Intel's HD Graphics software on Windows see comments for more details). On Windows, you hold Ctrl+ Alt while pressing the up ↑ or down ↓ arrow keys to add cursors.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |