Coding

PHPStorm Introduction – Navigating around

  • 00:00:00 Hyatt's I'm back and in the last video
  • 00:00:03 we had a look at how we could change the
  • 00:00:05 appearance of our editor of the IDE and
  • 00:00:08 this video I want to well talk about not
  • 00:00:11 a very important thing
  • 00:00:13 navigating around in the IDE there are a
  • 00:00:16 couple of ways to do this and of course
  • 00:00:18 there are quicker ones and slower ones
  • 00:00:20 and generally when coding you want to be
  • 00:00:23 as quick as possible
  • 00:00:24 and not lose much time on searching for
  • 00:00:27 a file or a function declaration so
  • 00:00:30 which options does peach peach Toto
  • 00:00:33 storm offer you well if you have a look
  • 00:00:36 at the navigate menu item here you can
  • 00:00:40 see quite a lot we have quite a lot of
  • 00:00:43 options available though of course some
  • 00:00:45 of them will be used more often some of
  • 00:00:47 them not as often one of the most useful
  • 00:00:50 ones is command shift o which allows you
  • 00:00:55 to type a file name so let's say I want
  • 00:00:57 to access some controller and then you
  • 00:01:01 get all these matching file names in
  • 00:01:05 your project now since this is not very
  • 00:01:07 specific let's let's open the light file
  • 00:01:09 the light modifier this will refer to
  • 00:01:12 this light file on the left now if I hit
  • 00:01:14 enter I open this file and I'm already
  • 00:01:18 there so this is a very quick way to
  • 00:01:20 access this and you get to certain files
  • 00:01:24 if you don't want to load search for a
  • 00:01:27 file but for a certain class you would
  • 00:01:30 press almost the same combination but
  • 00:01:33 not command shift o but just commando
  • 00:01:36 and now you may enter whichever class
  • 00:01:39 name you're looking for so if it's the
  • 00:01:41 post class you can open up the file
  • 00:01:44 which is the post file in this case but
  • 00:01:47 it is opened because it has to post
  • 00:01:49 class inside of course you can also
  • 00:01:52 navigate around here in this tree folder
  • 00:01:54 or this file file tree and well pick
  • 00:01:57 whichever file you want to open and does
  • 00:01:59 this find you but keep in mind the outer
  • 00:02:02 way is faster and when working on a real
  • 00:02:05 project you want to train this it will
  • 00:02:08 save you some time if you are in a file
  • 00:02:11 like this post controller which has
  • 00:02:14 lot of code or more code and fits on one
  • 00:02:17 line on one page at least you can get a
  • 00:02:20 list of all the functions for example in
  • 00:02:23 or all the items generally in this file
  • 00:02:25 by pressing command f12 and here you can
  • 00:02:29 see all the methods this controller has
  • 00:02:32 and you can of course quickly jump to a
  • 00:02:34 method by just single clicking on it so
  • 00:02:37 this is also a very quick way to
  • 00:02:39 navigate within a file and to find
  • 00:02:44 something in that file another way to
  • 00:02:48 quickly enter a file or create a new
  • 00:02:50 file for example is to press command up
  • 00:02:52 this will also open this file free but
  • 00:02:56 navigatable with your arrow keys right
  • 00:02:59 inside your editor here and now let's
  • 00:03:02 say I want to create a new controller I
  • 00:03:04 could just select controllers folder and
  • 00:03:06 then press ctrl n to create a new file
  • 00:03:09 and this will allow me to quickly create
  • 00:03:11 a new file inside as well see you know
  • 00:03:16 not at this insiders controllers folder
  • 00:03:19 the same could be done by pressing ctrl
  • 00:03:21 + here or of course right-click new file
  • 00:03:26 and you may choose whichever way you
  • 00:03:28 prefer but I really recommend practice
  • 00:03:32 with it you will be faster you will
  • 00:03:34 really be faster if you try to use the
  • 00:03:37 command or the keyboard commands as
  • 00:03:40 often as possible now what is if you
  • 00:03:44 like to use a certain keyboard command
  • 00:03:46 but you don't like the shortcut while
  • 00:03:49 you can't change this so command-comma
  • 00:03:51 brings you into the preferences and
  • 00:03:53 there you get the key map item here you
  • 00:03:57 can change every single shortcut which
  • 00:04:01 exists in phpstorm
  • 00:04:03 and you cannot only change each shortcut
  • 00:04:05 you assign can assign a shortcut to
  • 00:04:08 pretty much each actions you are able to
  • 00:04:11 do in this IDE now as before you are
  • 00:04:15 also able to search for specific actions
  • 00:04:18 here so if you want to change something
  • 00:04:20 with navigate inside you might type
  • 00:04:22 navigate here however this is
  • 00:04:26 so hard to find probably so if you know
  • 00:04:28 you want to change a certain shortcut
  • 00:04:31 let's say command f12 is too difficult
  • 00:04:34 to reach you might click the smack
  • 00:04:36 magnifying glass here and then here you
  • 00:04:38 can enter the shortcut you want to
  • 00:04:40 change come out of 12 for example and
  • 00:04:43 this will search for the item which is
  • 00:04:46 brought up with the shortcut and then
  • 00:04:49 you can just remove this to remove the
  • 00:04:53 shortcut and then add a new shortcut
  • 00:04:56 whichever fits your needs more now of
  • 00:05:00 course if you use one which is already
  • 00:05:03 assigned to something else you will get
  • 00:05:05 this warning here and you may of course
  • 00:05:07 overwrite this and this will work which
  • 00:05:10 has removed us from the a ver items or
  • 00:05:13 actions and you of course you should set
  • 00:05:16 the shortcut you want and if this
  • 00:05:17 overrides the shorter of another action
  • 00:05:20 you have to decide as just act an
  • 00:05:21 important to you if yes pick an average
  • 00:05:23 shortcut for it if no well then no
  • 00:05:26 damages cost and with these shortcuts
  • 00:05:29 and the possibility to change them and
  • 00:05:32 to adjust them to your needs you are
  • 00:05:34 able to quickly navigate between files
  • 00:05:37 classes inside a file create new files
  • 00:05:40 between the different folder structures
  • 00:05:43 and that really are the most important
  • 00:05:46 things here