تماشای این درس نیاز به اشتراک حرفه‌ای دارد.

Browsing Files with Command-P0:00

Let's review the two most important keyboard shortcuts. First is Command-P to browse any file on your system. So that's why, if you watched the last video, I hide my sidebar with Command-K-B. Instead, I use Command-P and type in the name of the file I need. Maybe I want my AuthController, and notice that as we're typing it, Sublime instantly switches to the file that most matches your sequence. That's one thing about Sublime, it's ridiculously fast. So maybe we want to go to one of our Kernel classes. Notice as I type letters, it instantly updates the active file, which is great. So memorize that one and use it religiously.

Notice as I type letters, it instantly updates the active file, which is great. So memorize that one and use it religiously. If you ever find yourself kind of doing this, well, unless you're just hunting around, you really don't need to be doing that. If you want your Request class, don't do it like that. Close that out with Command-W, and then close the sidebar, and instead use Command-P to hunt down your Request class. Much better. Next, we have Command-R, which is to browse to a symbol. So if you take a look, in the Go To tab,

Jumping to Symbols0:59

Next, we have Command-R, which is to browse to a symbol. So if you take a look, in the Go To tab, go to Symbol, and also Go To Symbol and Project. These are incredibly useful. So for example, let's say we have... well, how about Laravel's Container class? Okay, so we use Command-P to switch here. And now, let's say you need to go to a specific method. How about the isAlias method? Alright, I'll hit Command-Up to go to the very top,

How about the IsAlias method? Alright, I'll hit Command-Up to go to the very top, or Command-W to go to the very bottom, by the way. Alright. So now, rather than manually browsing for that method, I will hit Command-R and type in the name of the method. Done. Much faster. And even cooler, we can group these together. So for example, I'm going to close that out.

Combining File and Method Search1:40

And even cooler, we can group these together. So for example, I'm going to close that out. Let's now go to the Container class, but the isAlias method, all in one swoop. Command-P, I'll type Container, and then I can hit the @ symbol, and notice that we instantly switch to the methods. So I can type isAlias. Done. And if you noticed, when we originally reviewed Command-P versus Command-R, the only difference is it added an @ symbol. So that means, yeah, I could type Command-P and then the @ symbol to switch over there.

Project-Wide Symbol Search2:05

the only difference is it added an @ symbol. So that means, yeah, I could type Command-P and then the @ symbol to switch over there. Command-R is just a shortcut to get you there. So that's really useful to know. You can browse to a file, and if you get to that file and then want to switch to methods, yeah, you could hit Enter and then Command-R and start again, or do it all in one go. Command-P, Container, @, IsAlias. Now, on that note though, if you know that you want to go to the IsAlias method on the Container class, well, that's what GotoSymbol and Project is for. By default, GotoSymbol will just display basically the symbols or method names or

Container class, well, that's what GotoSymbol and Project is for. By default, GotoSymbol will just display basically the symbols or method names or selectors if you're in a CSS file, but that would be exclusive to the current file. If you want it in your entire project, Shift-Command-R is what you want. So we try that out, IsAlias, and notice how fast that is. You can't get any faster than that. All right, so toy around with these two keyboard shortcuts and commit them to memory. You'll use them more than anything else.

دوست دارید گاهی خبرهای Laracasts را ایمیل کنیم؟