Installing Vim Emulator 0:00Maybe, you're switching over to PHPStorm from something like Vim, and as anyone who's used Vim for any period of time knows, very quickly those helpful keybindings become ingrained into your fingers. But luckily, just because you're switching over doesn't mean you have to abandon those. So let's get that set up. Command comma to open up the preferences. Let's search for Vim, and this is the one that we want. So let's install it, and it will probably ask us to restart. So let's do that now. Alright so we should be all set to go.So let's do that now. Alright so we should be all set to go. So if we go up to tools, down to Vim emulator, we can enable it and disable it how we need to. But now you can see it switches to the more familiar block cursor, and we're all set to go. Now on that note, this video is really for the people who know what this is and know why they want it. If you're not familiar with this at all, I'll show you a couple things, but really it's just meant to pique your interest. Vim Modes and Navigation 0:50If you're not familiar with this at all, I'll show you a couple things, but really it's just meant to pique your interest. If you want to learn more, there's countless Vim tutorials on the web. Anyhow, for the quick recap, I can press I to go into insert mode, and think of this as the regular mode that you're already familiar with. However, at any point if I hit escape, I'm now in normal mode, at which point I can use the HJKL keys to move around. So here I'm pressing K to go up, and J to go down. If I want to advance a word, I can hit W. So here we go ahead one word each time, or I can hit B to go back.If I want to advance a word, I can hit W. So here we go ahead one word each time, or I can hit B to go back. For example, let's go down a few clicks, and maybe I want to change the text within these parentheses. Well, anywhere within here I can find that first parentheses. So I can hit F, open parentheses. Now if I want to change what is inside of these parentheses, I could hit C, I, parentheses. And of course at any point if I need to undo it, I can hit U for undo. So once again, if you're not familiar with VIM, this may seem like, oh my god, how many keys can you possibly learn? Editing and Visual Mode 1:49So once again, if you're not familiar with VIM, this may seem like, oh my god, how many keys can you possibly learn? But the fact of the matter is, if you will take the time to memorize some of these shortcuts, you're going to be a much more efficient developer. I use this stuff every single day, and I don't even think about it at this point. So for example, imagine that we want to empty out everything between these two braces. Well, once again I could hit C, I, opening brace, and that will remove or change everything in the inner braces. Or if I want to select lines, I can hit V to insert visual mode. So now notice that we can select all of these lines here.Or if I want to select lines, I can hit V to insert visual mode. So now notice that we can select all of these lines here. So we could hit capital V to select this full line, go up a few ways, hit D to delete it, I to go back into insert mode, and continue on. But once again, if you've never used this stuff before, I can easily understand how that would seem overwhelming and unnecessary. But I can show you countless people who would say it very much improved their workflow. So now, for those of you who are switching over from VIM, you probably have some massive VIMRC file that is perfectly configured to your tastes. Well, you can't port all of that over, but some of those things you can. Configuring IdeaVimrc Mappings 2:52VIMRC file that is perfectly configured to your tastes. Well, you can't port all of that over, but some of those things you can. To do that, simply create an IDEA VIMRC file within your home directory. Touch IDEA VIMRC. So notice it's the exact same thing as your normal VIMRC location. We're just adding this to point directly to the IDE. Okay, so why don't we just update this file really quickly within the terminal, and maybe we'll create a quick mapping. So insert map, when we hit JJJ, we want to escape. This is one of the more common mappings that allows you to escape into normal mode.So insert map, when we hit JJJ, we want to escape. This is one of the more common mappings that allows you to escape into normal mode. All right, that should do it. So now if we cat that file, there we go. Now if we restart phpStorm, we should now be able to use this. So let's create a new line. I'm in insert mode, type some stuff, but now if I hit JJ, we're back in normal mode. So all of those sorts of mappings can now be added to your IDEA VIMRC file. And that should do it. So just keep in mind, it's not a perfect port. Limitations and Wrap-Up 3:51And that should do it. So just keep in mind, it's not a perfect port. You're not going to be able to use everything under the sun. You can't access console commands within the IDE. Unfortunately, that stuff just isn't available as of yet. But nonetheless, the huge majority of the keybindings will be available to you. And like I said, if you've never used this stuff before, you can either, one, feel free to completely ignore it, or two, look into why so many people are passionate about this stuff.stuff.