WEBVTT

NOTE Created by CaptionSync from Automatic Sync Technologies www.automaticsync.com

00:00:01.046 --> 00:00:06.906 align:middle
I just hate seeing developers click manually
into their directory tree to search for things.

00:00:07.446 --> 00:00:10.466 align:middle
Most projects are too big to
be opening files like this.

00:00:10.916 --> 00:00:14.416 align:middle
Really, you want to have your hands
off your mouse as often as possible.

00:00:15.806 --> 00:00:19.566 align:middle
Time to introduce you to some new
best friend shortcuts for navigating!

00:00:20.236 --> 00:00:24.526 align:middle
In fact, PHPStorm thinks they're so important
that they even have some of these listed front

00:00:24.526 --> 00:00:26.576 align:middle
and center when you don't have any files open.

00:00:27.546 --> 00:00:29.186 align:middle
Click the navigate menu at the top.

00:00:29.616 --> 00:00:32.106 align:middle
The first option in the list
is "Navigate to Class".

00:00:32.646 --> 00:00:34.556 align:middle
Its shortcut is command+O.

00:00:35.246 --> 00:00:40.056 align:middle
Knowing that I want to get into the MovieType
class, I'll hit command+O, start typing the name

00:00:40.056 --> 00:00:43.126 align:middle
and boom, I've got that open
with just my keyboard.

00:00:43.766 --> 00:00:46.076 align:middle
Need to open a file, like config.yml?

00:00:46.426 --> 00:00:53.056 align:middle
Well you're in luck, just use
command+shift+O, start typing the file name

00:00:53.056 --> 00:00:55.006 align:middle
in the search box and there it is.

00:00:55.036 --> 00:01:00.356 align:middle
We could even look up this
bootstrap_3_layout thing here.

00:01:00.746 --> 00:01:06.226 align:middle
Use command+shift+O again, type the file name,
and we can see where it is in the project.

00:01:07.016 --> 00:01:10.396 align:middle
Great! In this case we can
see how deep that structure is

00:01:10.396 --> 00:01:13.666 align:middle
for this particular file,
it's way down in Symfony.

00:01:13.666 --> 00:01:17.566 align:middle
If I saw you navigating here manually,
I'd be tempted send Samuel L Jackson

00:01:17.566 --> 00:01:19.256 align:middle
to your office to tip over your chair.

00:01:20.136 --> 00:01:22.326 align:middle
He'd arrive before you navigated there.

00:01:23.206 --> 00:01:26.556 align:middle
And what's really cool - other
than not being tipped over by Sam -

00:01:26.556 --> 00:01:31.436 align:middle
is that we can use the navigation tree on
top to actually click and look around inside

00:01:31.436 --> 00:01:36.176 align:middle
of these deep directories.If we really
wanted to, we could move the tree

00:01:36.176 --> 00:01:41.786 align:middle
on the left all the way to that specific spot by
double clicking that directory name at the top.

00:01:42.256 --> 00:01:46.186 align:middle
And now we're there and can look around and see
what other interesting stuff is hiding here.

00:01:51.836 --> 00:01:56.786 align:middle
The next shortcut on the list up there
is "Symbol", which is command+alt+O.

00:01:56.786 --> 00:01:59.056 align:middle
Symbol is referring basically to function names.

00:01:59.456 --> 00:02:03.996 align:middle
So here we can look for something like the
buildForm method from inside of my MovieType.

00:02:04.606 --> 00:02:08.416 align:middle
And now it's showing me all of the instances
in the project where buildForm is used.

00:02:08.416 --> 00:02:10.926 align:middle
I'll pick the top one and
it takes me straight there.

00:02:12.066 --> 00:02:14.716 align:middle
Inside of my controller I call createForm.

00:02:14.926 --> 00:02:19.716 align:middle
So back to command+alt+O, type
createForm, and there is the one inside

00:02:19.716 --> 00:02:21.826 align:middle
of the base Controller class we extend.

00:02:22.436 --> 00:02:27.526 align:middle
This is the function I am calling when I say
$this-&gt;createForm() from inside MovieController.

00:02:32.686 --> 00:02:36.666 align:middle
In this case, if I wanted to know exactly
where this createForm() function lives,

00:02:36.936 --> 00:02:41.116 align:middle
I would just hold command and click into it --
so don't forget about that shortcut as well.

00:02:41.116 --> 00:02:45.096 align:middle
We can do the same thing here for handleRequest
if we needed to know where that is.

00:02:45.446 --> 00:02:50.356 align:middle
Clicking that will take us right into this core
Symfony spot and again we can look around inside

00:02:50.356 --> 00:02:52.256 align:middle
of here and double click
the tree to move us here.

00:02:54.176 --> 00:02:58.136 align:middle
Most of the time, you might be
interested in the shortcut command+E:

00:02:58.696 --> 00:03:00.866 align:middle
this will pop up a list of your recent files.

00:03:00.976 --> 00:03:04.606 align:middle
Just start typing the name of the file you're
looking for until it appears in the results.

00:03:07.276 --> 00:03:10.926 align:middle
Once you have some tabs open, you'll see
me do this a lot: my cursor will stay

00:03:10.926 --> 00:03:13.996 align:middle
in place while I hold command+shift+

00:03:13.996 --> 00:03:18.976 align:middle
[ and command+shift+] to
move around the open files.

00:03:20.076 --> 00:03:23.276 align:middle
I use this constantly to jump
around from one file to the next.

00:03:25.076 --> 00:03:27.686 align:middle
Okay, the last shortcut I'm going
to show you for finding things

00:03:27.686 --> 00:03:30.666 align:middle
in your project is easy to
remember: shift+shift.

00:03:31.336 --> 00:03:34.426 align:middle
Hitting shift twice will open up a
feature called 'search everywhere'.

00:03:35.156 --> 00:03:38.346 align:middle
This is a bunch of searches put together,
where you can start typing MovieController

00:03:38.346 --> 00:03:41.596 align:middle
and find that, or buildForm
and it will find that for you.

00:03:42.826 --> 00:03:44.406 align:middle
Or you can even find CSS tags.

00:03:44.916 --> 00:03:49.596 align:middle
In one of the core Symfony files, there's
a CSS snippet called .block-exception.

00:03:49.916 --> 00:03:51.746 align:middle
And there it is in our list of results.

00:03:52.576 --> 00:03:55.876 align:middle
And clicking on it takes you straight
to that file deep inside of Symfony.

00:03:57.406 --> 00:03:59.916 align:middle
There are a lot of ways to move around
your project, but the biggest ones

00:03:59.916 --> 00:04:04.326 align:middle
to remember are command+O and command+shift+O.

00:04:04.326 --> 00:04:06.116 align:middle
Or put them together, with shift+shift.

00:04:06.846 --> 00:04:09.176 align:middle
Ya! We're working way faster.

