FREELessons: 34Length: 2.5 hours

Next lesson playing in 5 seconds

  • Overview
  • Transcript

2.5 Instant File Changing

Let's say that I need to, in this project, edit one of my view files. Well, it's possible that maybe if you're coming from an IDE or something like that, you would go to Application, then you'd go into the View, then you'd go into Home and then you would open up your view file. Now on a side note, I want you to keep in mind, notice how the syntax isn't right. And that's because I'm using a templating engine called Blade, but the problem is that, there is no syntax for Blade, as you can see right here. But with Sublime Text, I can install Blade syntax highlighting in literally about four seconds. So stay tune for that in a future lesson. But now, going back to browsing the files, that sure did take awhile. And again, I'm being relative here. It took about five seconds, but if every time I'm going to a file, I can do it four or five more seconds more quickly than you. Imagine how much more I can get done over the course of a year. This stuff really does add up. So instead, what I'm going to do is open up something similar to the Command Palette. I'm gonna hit Cmd+P or Goto Anything. So think of this in the same way as you think of your Command Palette, but this is specifically for your files and you still have fuzzy searching. So if I know I need to go to the Home view, I can type home forward slash and now that's going to return any of the files that have home in them. And technically, this is fuzzy searching, so it's returning any of the files that have H-O-M-E and forward slash within them. So another way would be views/home, that would work, too. And now notice I don't have to browse to the side bar at all. Or think of other ways that you can identify your views. If I know that I use a templating engine, well, blade is a rather unique word. So Cmd+P, look for any files that have blade in them and now we get the blade source file. I'm instantly there. So in this case, I'll go to home, look for blade files and now we have that or I would likely go to views index and then I would find it. In this case, I want the first one. So now I'm there. So this means that once you know your file structure quite well, you can hit Cmd+KB to hide the sidebar and now you rarely need to go there. When I need to edit, for example, that paths.php. Cmd+P, paths.php and I'm there. Or Cmd+P, test.js, I'm instantly there. Now what makes this so powerful is, well, let's say that other apps have this functionality, but it's not nearly as fast. So if I were to open bundles, I want you to note that in other apps, you would have to find the file hit Enter and then it would be loaded. But in Sublime, it's immediately opening the topmost file which matches your query. So for example, let's say that we instead want this bundle.test file. Well, I'll hit Test and now notice, it's instantly updating the file in the background. And what your going to find is I've used lots of the editors and this is far and away the quickest implementation available. And that does it for this lesson. So remember, Cmd+P to bring up the go to anything palette. Type the name of the file, hit Ignore. It does not need to be the entire path or the entire file name, you just want to think out the identifier. So in this case, I don't have to type period for getignore. I can really just type ignore and that will come up. All right. I'll see you in the next video.

Back to the top