Navigating by Symbol0:00
Now, you're likely familiar with Command-P, so if I want to go to my User class, I'm instantly there. But don't forget you can also browse or go to by simple using Shift-Command-4 on the Mac. Go to simple in project. So imagine we have a method, let's go to our ServiceProvider, and let's just add, well let's use register. Okay, well if you want to visit that method, yes, you can go to the file, or you can browse by simple, Shift-Command-R, register. Now just remember the more generic the name, the more options that will come up.
File and Method Jump0:49
Now if I add another method, oh, I don't have snippets yet on this machine. This is, again, a very fresh install of Sublime. My method, and I need to browse to that, Shift-Command-R, my method, and there we go. Try to use that as religiously as you can. But there are some cases where, like with the register example, it feels dumb to browse the entire system. So in those cases, yes, you could say Command-P, AppServiceProvider, Command-R to browse by simple, and then go to register, but you can also do that in one line. So you could do Command-P, AppServiceProvider, and then at simple to find the method within it. So now the cursor is with register, and I can change it there.
Using Fuzzy Search1:22
So you could do Command-P, AppServiceProvider, and then at simple to find the method within it. So now the cursor is with register, and I can change it there. So you can even shorten this because it will use fuzzy searching. So I could do Command-P, AppServiceProvider, so SP, yeah, just any kind of fuzzy search you want, and then you can immediately browse there, and it will go to the first result. So I usually do title case or the first few letters, and then I tack it on like that, and then I go to my method really, really fast. So let's do one more. Let's say I need to go to my AuthServiceProvider, and I know I need to modify the boot method.
Avoiding the File Tree1:55
Let's say I need to go to my AuthServiceProvider, and I know I need to modify the boot method. Maybe you're reading documentation and they tell you to do this. Okay. Well, in general, don't always go to the file tree here, find the file. It's so slow. In reality, I usually keep that sidebar closed with Command-KB all of the time, and then I will either browse by symbol, doing boot, or once again, AuthServiceProvider, at boot, and now I'm there really, really fast.
