Become a PHPStorm Ninja - Improve your productivity in PHPStorm by 10X

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone thank you for tuning in to another episode on the channel and in today's episode you will learn how to be more productive with phpstorm in this video we're gonna go over a few things like shortcuts shortcuts how to add your custom shortcuts at the same time we're gonna go over things like adding a file adding a PHP class adding a PHP method using phpstorm adding plugins to phpstorm customizing a little bit of your editor and we're just gonna go over them really briefly but you can play with it on your own also using get connected darker and running unit tests so let's not waste time and get started the first thing we're gonna be going over is the double ship so we're gonna start with shortcuts and to me this is where phpstorm just stands out above the rest I've used other text editors and honestly phpstorm is the one that performs better for me so this is the one that actually makes me more productive and I've heard the same from a bunch of people I did try vs code I did try sub line for a while I did try Adam and definitely this one is the one that has a bunch of more things that I need so again if we go into the double shift if we do that you're gonna see this option come up so basically what this is is just going through all the different files and all the different things that you have in your project so that's a good thing because you're searching everywhere within your project so basically I can go like this and say hey I want to find this burger or maybe something that is not there I want to find an ID like one of my CSS classes or one of my CSS files I want to go ahead and find that I can you know and and it'll take me right there really fast and that is good except that when you have a very large it can get very slow at times so in my opinion I like using shift command Oh which is one of the commands that we have in here and basically shift command Oh gives you the same thing but it goes right into file so if you know you're gonna be searching for a file you can just use shift command oh and we'll search for the files and you can go to that file really quickly it's a lot faster than doing double shift because Eid will it's not looking for it everywhere like in your classes and your texts in your files it's just looking for it in files if you just do shift command oh another way you can do this if you want to go back into that style example we can do a shift command F and which shift command F you can go and do the same so in this example I was trying to find nav bar I can go in nav bar and then I can quickly navigate through everything that has a nav bar in it and I can see it right here okay that's not the one that I'm that I want or you know I can move really really quickly through it and that gives me a much better way for me to find things texts within these files so that shift command F for finding texts within the files and shift command o for finding actual file names the next the next one we're gonna be going over in here is shift command a and basically shift command a just gives you the same thing as you see here action so if I want to find a certain action within this like for example I want to search for something like soft or safe you know you can right here so if I do if I want to say for some reason I can go in here and like find exactly what I want and here you see how it has a short code so I can actually use the shortcut or just right here if I I can navigate through it with my arrows and then enter it if I want to so that's gonna save that file for and that's very handy when you don't know exactly what you're looking for maybe you have an idea and you don't know where it is you can quickly do shift command a and find find actions like that within phpstorm the next one is f2 this one is very handy for finding errors so if you want to let me see your file that has errors if you want to find errors within a file it's really simple with phpstorm all you do is tap on f2 and it's gonna take you error by error down every single error that you have on that specific file so in this case this one for example is saying it's a typo I can just do alt enter and then once I do I'll enter I can save that into my project directory and I don't in the dictionary sorry and then that's already saved so it's not gonna be an error anymore if I had more errors I just keep pressing f2 and that's gonna take me through all the different errors that I have within that file which is awesome when you're trying maybe you have a file that has a bunch of errors or maybe you don't you're just getting started with the file or you have somebody else's file you're trying to fix some errors that that really comes in handy for you command e gives you a list of the recent file so I use this a lot because say you don't have you're not looking over on this bar over here of what files you have all I gotta do if I want to go back like for example oh I want to go back really quickly to the app service provider is I can just command E look the file the last file is gonna be the first one or I can look for webpack whatever file that I just recently opened so maybe I'm working on the last two or three files maybe I'm making some kind of service or something with PHP or something with JavaScript I can definitely go through all those files really quickly with command e and it's only gonna give me like it says in there only the last files that were open the next one it's out up so that this one is actually why I quit vyas code and maybe there was something I was missing with BS code one thing with BS code is that I had to add a lot of plugins and a lot of different things for the functionality that phpstorm has out of the box and it's not only phpstorm every IntelliJ text editor has these options so uh first of all I'm used to it and second of all this is the one that I just couldn't find a replacement for and I just I realize I can live without it so if I go here in the front I can give you a better example say I want to select everything that's within this navigation tag right here all I have to do is do alt up and continue to do that until you see that everything gets selected so what was selected is everything within that navigation tag right here nothing else and that is awesome because now I can just be right here within this this right here within this day of like logo right wrapper and I say you know what I want to copy this logo I can just do that like I can just go alt up and it's gonna give me that logo wrapper and I can copy it or move it or do whatever I want with it another good one is shift command up that's gonna move it up as you see so right now is out it's inside the container class right here and if I do up its gonna be outside of the container class if I do down it's gonna be inside so this really is really powerful when you're working with a lot of files and you want to get things done really quickly and honestly to me this was the one that sold me on like okay I'm just going back to phpstorm and paying the monthly fee because I just can't live without this one so all down is the same thing so it's just the opposite so it all up we're selecting with alt down we're dis selecting so we're decreasing whatever the current selection is so again if I go into the logo wrapper that selected if I go back that's not selected and even if I go inside like this PHP and PHP files right here this is Lara Bell so I'm right here if I keep selecting you see how first it selects this then it goes everything inside the local rapper then then it's everything inside the Knapp brand and if I do down you see how everything just goes back to each stage of the selection that we were on and that's really to me really powerful the next one we're going to be going over is shift command right so we shift command right what you can do is say that you want to copy everything that's from this point to the right all you do is shift command right and you're gonna copy everything from this point to the right and the same thing with the left so as you're going down say you found a line you find a piece of code that you can reuse or or something like that and you just want to copy that then you can just boom really quickly select it this is the same as shift command right just goes to the left shift my right goes to the right shift command no we went over so basically you search through files and I can go through the file again app service provider right there the same thing with shift command F that's for search for text in the project control G so this one finds the next occurrence of the current selection so what this means is sometimes you may need to change for example say I wanted to change this URL configuration app URL right here if I want to find every occurrence within this file or just the next occurrences I can just do ctrl G and as I go down with control G it's gonna find every occurrence of that in the same file and this is awesome because now I can just change this all at once you see so it changed this one this one and it changed the one that I found right here so I don't need to go one by one and change them you know one by one I can just change them all at the same time that's a really really big time-saver to me I'm all about saving time so ctrl G command D it duplicates the current line so if I want to say have another burger menu right here all I do is command D and that's gonna give me a duplicate of that line command one opens up this sidebar right here so if you do command one you have access to the sidebar which has all your project and your projects files in it and you can quickly navigate through that if you don't know exactly the name that you're trying to find and you don't want to use shift command o for some reason then you can definitely find it like this so just go command one and quickly go through all your files within your project that is good for you to get get a good understanding of your project and then command seven gives you a good understanding of your current files structure so this is for the structure this one's for the sidebar for the project and command seven is for the structure so that'll give me a good idea for example displayed file what it has and how it works so I can go through it clear enter on it and then it's gonna take me right into each one of these stack and this yield content and I use it mostly for PHP files and also JavaScript view j/s files and react files and this is really good for you to understand maybe some large files when some some of your colleagues maybe wrote a very large files with a lot of methods on it class with a lot of methods then definitely go you can go through it and get a better understanding of how what each method is doing and how it works right here just looking at the structure of the file and as you see each one is different and it gives you a different map structure of each file so that's command 7 and then command 1 and with that these are some of the shortcuts that are used in most that those are not the only one by by any means there are a lot more and you can probably just leave on leave some more shortcuts in in the comment section I would love to hear from you and love to hear what shortcuts you use the most which ones are your favorites these are just some of the ones that allow me to save time but definitely I'm open to learning a lot more from you and seeing what other shortcuts you use and with that we're gonna go into customizing the key map so you can actually customize all these shortcuts your liking you don't necessarily have to keep the ones that phpstorm provides you can also download plugins that have different key maps that maybe you're looking for and how do you do that well it's easy so if we do command comma we're gonna go right into the options so you can either do phpstorm preferences or as you see here command-comma command-comma it's gonna take you right into this menu and you can go right down into key map and there are two ways you can search for a key map you can either say something like I want command line and run like which one is the one that runs my command line look for that or you can search for a specific shortcut right here so I can say hey which one is command 5 you see how I have this one map to terminal I did that by default so I actually went in and changed this I looked for terminal bound terminal and then I clicked on it you can do add keyboard shortcut and then right here you can change to whatever shortcut you need and the result of that is that I can just do command 5 and I my my terminal right here available for me you can do this with any uh any shortcut you want so if you have one that you're trying to use and you can find it you can definitely search for it right here or change whatever you already have set right here so you can look for maybe some of the shortcuts like say I wanted to change shift command oh you see how it's go to file maybe you wanted to change that to something else you can definitely do that so you will have to remove it and then add it somewhere to whatever action you're trying to do and like I said before there are a ton of more shortcuts so don't think these are the only ones there are a ton more these are the most popular I will believe the ones that most people use but definitely check out the documentation so if you can go through jetbrains this link right here I will leave the URL in the comments you can go through that and look at every single one that they have or you can find some more resources on Google these are just some examples so just don't be constrained by only these examples right now we're only we're gonna be moving on from key maps into the next into the next section which is gonna be more of like just using it and the first thing we're gonna be going over is Emmet so what is Emmet I go here and my front-end lay that PHP say you wanted to create a HTML structure usually you do like Dave and then you do say maybe you want an h3 and the way I'm doing that I'm just doing a ch3 and then tab and that gives me already the entire HTML so I don't have to write h3 and then closing and then and then the closing tag for h3 I just do h3 tab and that's what the Emmet is doing so if I want to create say for example a bootstrap tainer with a row with three columns and in one of the columns I want an h3 I can just do something like bootstrap okay Dave and that's gonna have a class container this container is gonna have a row so actually it's gonna have a child that's gonna have a row and this is gonna have a future few children that are gonna have a call for and I'm gonna do times three so let me tap on that you see right here I just generated very you know extensive and you can see how if you're doing more it's gonna get bigger and bigger and bigger and it's just better when you know how to do these things because you can save a ton of time especially if you start practicing eventually you'll master some of these things and you'll really get things done a lot quicker than you did before so let me do that close it so that was Emmet and the next one is how to create a new file so how you can create a new file within phpstorm again command one and i go in here into my app say i wanted to add a new controller I go into controllers and I do command N and that's gonna give me a list of things to do so what do you want to do you want to create a PHP class a PHP file and I'm sort of gonna do this one with a PHP class already and I can do new controller whatever name I wanted to have for that controller and that's gonna give me a controller class and the file name obviously and that's that's really good because you then you don't have to like create the file and then come here and add PHP in namespace and all that it already generates it for you and again just like I created a class right here you can just create a file so if you wanted to do a JavaScript file or a view component this view component it's actually a plugin I will get into that in a little bit but you can create all of these different files without any problem actually it's really really easy to do and again if we go into the class we can create interfaces or we can create traits so if I wanted to just create an interface I can just say controller interface and what that's gonna give me it's an interface of that and that's awesome because it honestly saves you a lot of time especially if you're writing a big service or something like that you can quickly create these files and just be on your way now we're gonna go into adding plugins so if we do again if we do command comma we can go into the plugins right here and these are some of the plugins that I have already the ones that you see that need update or if you want to find any plug-in that you want your trying to use you you click on marketplace and then you can find it from one so I don't have the laravel support I don't have some of those or yet but definitely give give some of these to try depending on what you're trying to accomplish I do have things like darker if you like you just saw so that allows me the view plug-in allows me to come here and do things like hey I want to create a new view component and that view component when I create it and actually let me create one so you can see it it's gonna have already the boilerplate for me so if I do here view component and I just do boilerplate you see it gave me already a template script style everything ready for me to just start coding the actual component itself and a lot of the plugins they give you a lot of help for what you're trying to accomplish this is really important because then you can extend phpstorm even further obviously as you add more plugins that adds more space more harddrive space not too much but it is uh if you're trying to just keep that down but also memory that you're consuming so I always try to keep that as little as possible only use the ones that I really really really need so now we're gonna go over how to style some of the editor how I style this editor for example if you go again command comma and you go into editor you can see here you have this option so you can go to general that gives you like a general idea of that but if we go for example into font I can change the font that you see in my editor right here so I can change that font let me see a change it'll give you a preview right here of what you're trying to do this is the one that is defined right here color scheme fun fire code and this is the color scheme that I'm using so you can use on ton of more color schemes I am actually using a plugin called rain glow and it gives me a ton of options so if I change for example to comrade life I don't want to change my options but basically you get the idea you can change a lot of these options let me just see which one I'm on color scheme I'm on brave so if I want to do a carbon that's gonna change the way this looks you see it's not very good looking but you get the picture you can change that as much as you want again let me go back to brave and the same thing with some coding styles you can make adjustments baek's based on the code the language that you are using so you can adjust that and just to go back into the color scheme that's how you can adjust your editor but there is a plugin that I use or used to use a lot which is the material theme and that gives you a really neat theme if you want to use also change this right here this interface I'm not using it anymore because of memory issues on my computer I'm very limited on that so I don't use it I don't honestly I don't see it necessary to but if that's something that you're into definitely go ahead and change the color scheme and all that for your for your editor and that's one of the other things that I really love about phpstorm it's all the options that it has for styling it and for you to actually have something personalize that you want to work in because you're gonna spend hours doing this so basically it's just good you know when you really like what you're working on honestly and then I'm gonna move on on get into get right here so if I do I have it mapped to command nine I think that's the default if not I I already showed you how to do key map a custom key key key short code so you can do that through the key map and we're gonna go into the get so right here you see how I change these couple things right here it's giving me a boiler plate and I change this color and what I can do with this is I can go in here or if file by file and I can commit that so I can go right here I can do a commit change the text of that commit message that I'm trying to do and then I can commit and push so that'll give you a commit and then push it into your repository that's awesome because if you don't really have to go out of phpstorm I use the command line for pushing get a lot but definitely I'm trying to use this one more and more because then I don't have to get get out of the editor at all that's again that's command nine so you'll see the option and say you have darker on your computer and you're trying to connect with darker the first thing you need to do is you're gonna have to download a plug-in called docker so I already have that installed and what that does it gives you the ability to add the darker instances into your current language so I am using PHP right here for this project and maybe this one doesn't have an interpreter yet but I can set it up so if I go here if I want to set the PHP CLI interpreter for this project I can go here add it and then that's what the plugins giving me the ability for me to add these things right here so I can do from docker I'm gonna do from docker compose and in this case I am using Lara Lara doc so I'm gonna have to find a configuration file for that specific instance see and that right there it's in a sibling directory called Lara doc right here actually yeah there it is so it went through Larry doc and then he went into docker compose yam oh that's inside Lara doc and now it's telling me hey I found these services I'm gonna be going over the workspace which is the one that the workspace at this specific darker instance uses for me to be able to access just a workspace or just a shell for the project and yeah I mean I can just hit OK and it's gonna map it for me so it already knows that the CLI interpreter for PHP for that specific project is the one that is configured on that docker compose yamo file this way when I run tests for example it'll know what file or what PHP interpreter to use and how to go about it and you can only do that if you add the darker plug-in so that I don't have debugger yet so that's fine it's very bare-bones project still so I don't have a lot of that so here I set it up so this is workspace I maybe change the name to docker PHP so I know that that's the PHP darker interpreter so now I already have the interpreter I think I'm using PHP 730 in there and that's it like I have already my PHP interpreter cetera set up for this project and this allows me to go and run tests so I don't I don't think I've run tests for this application well we can try it out and that's one more thing that phpstorm does you can do command all our and that's gonna give you an option here where you're gonna be able to run some of these tests as you see this test basic example is the one that I that I want to run so I just go down on this one go right and then run and this right here it's gonna go into docker it's gonna get the interpreter from there I don't have it set up yet but basically that's what it's gonna do and it's gonna run the test for that specific through the specific PHP interpreter inside of docker and it's gonna run this test right here so that brings me to the conclusion you sure you are a lot better right now with phpstorm if you have any more tricks shortcuts or anything you do with phpstorm please feel free to leave a comment with your with your suggestion and I'm more than happy to try it out make sure you subscribe to the channel make sure you leave comments make sure we interact and make sure you hit the bell so you can be notified I'm doing one video a week so you can expect that from me have a great week once again and I wish you the best stay safe make sure you wear the mask and have a good one
Info
Channel: AndresAbello
Views: 1,878
Rating: undefined out of 5
Keywords: phpstorm tutorial, phpstorm laravel, phpstorm tips and tricks, phpstorm review, php tutorial, phpstorm, software development, developer tools, laravel phpstorm tutorial, jetbrains, jetbrains phpstorm, jetbrains academy, style up phpstorm, phpstorm shortcut keys, phpstorm show console, how to use phpstorm, phpstorm docker, phpstorm custom keymap, phpstorm custom shortcuts, developer tools tutorial, php tutorial for beginners, ides, php tutorial 2020, jetbrains phpstorm 2020
Id: I_KVRLvrsT8
Channel Id: undefined
Length: 31min 23sec (1883 seconds)
Published: Thu Jul 02 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.