Multiple Cursors Overview 0:00If you are switching over to PHPStorm from something like Sublime Text, then there's no doubt that you're a huge fan of its multiple cursor support. But don't worry, PHPStorm has this. The keybindings are a little different, but luckily, because everything is configurable, we can make it exactly the way it was in Sublime. First though, let's go over the 101 process. So you can see I have just a few simple routes to demonstrate this. Imagine that we want to change all the various references here of posts to something else. Maybe articles. Alright, well, the first option would be to manually do it. Adding Cursors Manually 0:30Maybe articles. Alright, well, the first option would be to manually do it. So if I press Alt-click anywhere, that will add a new cursor. So for example, I will just do it a handful of times here. And now we can change this. Pretty cool, right? But that can be a little tedious having to manually do it. So instead, we can select the next occurrence of the word underneath the cursor by pressing either on the Mac, Ctrl-G, or if you're on Windows, I believe it should be Alt-J. So if we try it out, Ctrl-G, that will first select the word, and now I'm just holding Selecting Next Occurrence 0:55either on the Mac, Ctrl-G, or if you're on Windows, I believe it should be Alt-J. So if we try it out, Ctrl-G, that will first select the word, and now I'm just holding down Ctrl, I can keep pressing G to select every other occurrence and also apply a new cursor. So now we can change it. Very cool. However, at least for my taste, Ctrl-G, my hand has to rotate counterclockwise a little bit and that's not overly convenient. Unless you like to map caps lock to Ctrl, which I don't. So instead, I want it to be more like Sublime, which is on the Mac, Cmd-D. Let's fix that. Keymap. Remapping to Cmd-D 1:28So instead, I want it to be more like Sublime, which is on the Mac, Cmd-D. Let's fix that. Keymap. And now, remember the trick I taught you. If you don't know the name, but instead know the shortcut, then we can type it in here. So Ctrl-G, and there we go. Select next occurrence. I'm going to remove that and replace it with Cmd-D. Now in my case, that shortcut is currently mapped to duplicate line, which is pretty useful. But I do want this to be Cmd-D, so I can always map that to something else. Alright, let's apply it, and now it should be more or less exactly the way it was in Sublime. Selecting All Occurrences 1:56But I do want this to be Cmd-D, so I can always map that to something else. Alright, let's apply it, and now it should be more or less exactly the way it was in Sublime. Cmd-D, a handful of times, change it back to post, and we're done. Now though, what if you don't want to press Cmd-D every single time? This is helpful when you just want to change a few spots. However, if you want to immediately select all occurrences on the page and provide a new cursor, how might you do that? Well, we can press Ctrl-Cmd-G, and we're done. Bring it back to articles, and that's good. And really, that's all there is to it.Bring it back to articles, and that's good. And really, that's all there is to it. So this can be incredibly useful, even for the cases where you just need to make a quick fix. While in the past, if you wanted to update this, you might manually do it like that. Well now, just select it, Cmd-D, change it, and you're done. So that's been your demo of multiple cursors, or as PhpStorm refers to it, multiple selections.