Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Gulp Basics Welcome to Gulp.js Your First Gulp Task

create sublime files from terminal. How did you do it?

On this video, you entered subl gulp.js and it created a file. How can I configure my terminal like that?

Thanks

7 Answers

Here's the answer: follow this and you can make it work: https://gist.github.com/olivierlacan/1195304

Hey Guys, this actually didn't work. -bash: subl: command not found

I'm using OSX Yosemite

Hey Guys, this actually didn't work. -bash: subl: command not found

I'm using OSX Yosemite

Tom Sager
Tom Sager
18,987 Points

The command " subl gulp.js" opens sublime and creates an empty editor buffer. The file is not actually created until that buffer is saved. That is why there was an error at the 3:57 mark - the file did not exist until he saved it.

Putting the file name in the command line is a little bit of a shortcut to "New File" followed by "Save As." The shortcut lets you simply do a "Save" instead.

Hey Tom Sager , right. That's what I was thinking it was doing, but do you know how to create that shortcut?

Tom Sager
Tom Sager
18,987 Points

What happens when you type "subl gulp.js"?

Katherine Wakefield
PLUS
Katherine Wakefield
Courses Plus Student 4,154 Points

You can also create an alias. Sorry for my ignorance with any more detail for default mac. I went to code school and we installed Oh My Zsh. In the terminal I type: 'nano .zshrc'

Then I created my alias: alias st2="open -a 'Sublime Text 2'" alias st3="open -a 'Sublime Text'"

Which means when ever I am in a project folder I can choose whether I was ST2 or ST3. Why do I use both? Well I don't - I have weened myself off of 2. This was my process.

Tom Sager
Tom Sager
18,987 Points

There is no alias or shortcut required. If you type "subl gulp.js", the 'gulp.js' is passed as a command line argument to sublime, which creates a buffer with that name.

This should work right 'out of the box' - unless the subl command has been aliased to something else, or installed differently, or ...

It works on my Ubuntu system running under VirtualBox. I don't what system Tony is running.

Hey Guys, I didn't actually try it! I will give it a go thx!