- Overview
- Transcript
2.2 Services and Opening Sublime From the Terminal
In this lesson, mostly for the Mac users among you, we'll add a service, so that we can right-click on a folder, and open the files within Sublime.
Note: recent versions of Mac OS may require that the Automator service be configured to pass input as arguments
rather than to stdin
.
1.Introduction1 lesson, 02:05
1.1Welcome02:05
2.Getting Started9 lessons, 35:20
2.1Installation and Base Settings04:54
2.2Services and Opening Sublime From the Terminal02:20
2.3Multiple Cursors and Incremental Search06:54
2.4The Command Palette04:13
2.5Instant File Changing03:19
2.6Symbols04:17
2.7Key Bindings02:33
2.8Installing Plugins Without Package Control02:54
2.9Package Control03:56
3.Snippets3 lessons, 14:40
3.1Your First Snippet09:04
3.2Adding Snippets Through Package Control02:32
3.3Easier Testing With Snippets03:04
4.Essential Plugins12 lessons, 46:58
4.1Zen Coding07:09
4.2Emmet06:52
4.3Cross-Browser CSS With Prefixr02:17
4.4Fetch Files With Ease 04:22
4.5Lightning Fast Folder and File Creation 02:12
4.6Sidebar Enhancements03:09
4.7Sublime Linter02:01
4.8Sexy Code Snippet Management With Gists07:50
4.9DocBlockr03:49
4.10Pretty Task Management02:42
4.11HTTP Requests Within Sublime02:29
4.12LiveReload02:06
5.Tips, Techniques and Modifications8 lessons, 49:09
5.1Regular Expressions in Sublime05:49
5.2Vintage Mode10:46
5.3Quicker Stylesheet References02:30
5.4Joining Lines04:40
5.5Sublime and Markdown with Marked03:10
5.6All About Projects 05:54
5.7Configuring and Mastering Split Windows07:19
5.8Custom Builds09:01
6.Closing1 lesson, 00:49
6.1Conclusion00:49
2.2 Services and Opening Sublime From the Terminal
One thing that would be nice on the Mac, and I'm sorry guys, this is more Mac specific in this video. So if you're a Windows user, feel free to move onto the next one. I would like to right-click on Project and choose something like, Open in Sublime Text 2. That would be helpful, right? That's not offered out of the box, but we can provide that functionality fairly easy. So I will open Automator, which all Mac users have, and we're going to add a new service. Now, the action that I want to run is a shell script, so I'll bring that in. So now, when we execute this service, it's going to run a shell script, and I'll paste this in. This is path to the Sublime text executable, and then I'm passing dash into create a new project with the given files. So now, our service should receive file or folders, whatever we specify,. And that's really all there is to it. So I'll hit save, and we're going to save it as Open-in-Sublime. And now if I close this out, I right click on the folder. Go down to services. We have a new option, Open-in-Sublime, and there we go. So now that we have the ability to right click on a folder and open it in Sublime, let's also offer the same functionality from the terminal. Ideally I should be able to within a folder just run Sublime, and that will open up Sublime with the current directories files in the side bar. But if I run it right now, nope that's not going to work. So let's add that functionality. It's a fairly easy process. All we have to do is create the symbolic link. So what I have here is, we're creating a new linking. I'm passing dash-s to create symbolic link. The first parameter is the full path to that Sublime executable, and now I'm creating the reference, or you can think of it as like an alias or pointer to the original file, and I'm placing that within my bin. Now, if you get this error right here like I did, permission denied, you may need to do sudo. So I'll do sudo, and a quick tip here, if I do exclamation point, exclamation point. That's going to bring in the last command that I ran. So if I run that, now notice that it just pastes that in. And if I run it, now we've created the symbolic link. So at this point you may need to restart the terminal, but once you do, now I will run Sublime period. And now everything has been opened and we're all set to go.