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

CSS CSS Basics (2014) Basic Selectors CSS Comments

Tommy Kristensen
PLUS
Tommy Kristensen
Courses Plus Student 3,031 Points

Default shortcuts do not work sublime text 3

everywhere in program, it says shortcut IS ctrl+/, but it doesn't work

Colin Marshall
Colin Marshall
32,861 Points

In Sublime Text 3, go to the edit menu, then go to the comment menu and tell us what the keyboard shortcut says for "Toggle Comment"

Also, are you on OS X or Windows?

Tommy Kristensen
Tommy Kristensen
Courses Plus Student 3,031 Points

it says 'ctrl + /', which is the wierd part. i use Windows and the code in Preference -> key bindings Default:

{ "keys": ["ctrl+/"], "command": "toggle_comment", "args": { "block": false } }, { "keys": ["ctrl+shift+/"], "command": "toggle_comment", "args": { "block": true } },

3 Answers

huckleberry
huckleberry
14,636 Points

CTRL + / is the hotkey for making a block of code into a comment. Is that what you're trying to do??

I use sublime text 3 as well and I use that hotkey all the time so I do know that it does what it's supposed to.

You have to highlight the chunk of text that you want to comment out and then hold down ctrl and press the /

Let me know if that doesn't work.

Colin Marshall
Colin Marshall
32,861 Points

You are correct. I don't have to highlight anything for comments to work though. They will work on a blank line allowing me to type a comment without selecting anything.

huckleberry
huckleberry
14,636 Points

Well slap me silly, I didn't know that. While I do often comment out chunks of code in order to test and debug and all that silly fun stuff, I wasn't aware that for single lines that you could just place the cursor and use the hotkey to comment out a single line. I thought you still had to select all the code on that line...

shazaam!!

Thanks buddy :)

Colin Marshall
Colin Marshall
32,861 Points

No problem! I love Sublime Text the more and more I figure out about it. So simple, yet extremely powerful.

huckleberry
huckleberry
14,636 Points

Same!

I really wish it had an auto-refresh in the browser when you make changes kind of thing like I hear brackets does. There was one package out there that I read about that offered that sort of thing but I couldn't get it to work.

Any knowledge about that?

Colin Marshall
Colin Marshall
32,861 Points

The package I saw that could do browser refresh for Sublime was not worth it for me. As far as I could tell, you have to hit an extra command after you save, and the tab has to be the active one in the browser window. It's just as easy to hit the refresh button in the browser.

I have recently discovered mixture.io and it does the browser refresh as well as preprocessing. It recognizes when you save a file in the open project (from any app, not just Sublime) and will refresh the browser. Best of all it's free!

CodeKit also does the browser refresh and preprocessing but it costs $32. It has a trial download for you to test out first.

Tommy Kristensen
Tommy Kristensen
Courses Plus Student 3,031 Points

that is the problem, it doesn't work. Along with other shortcuts.

the code in Preference -> key bindings Default:

{ "keys": ["ctrl+/"], "command": "toggle_comment", "args": { "block": false } }, { "keys": ["ctrl+shift+/"], "command": "toggle_comment", "args": { "block": true } },

i use Windows btw

huckleberry
huckleberry
14,636 Points

Yeah I've often just felt that alt+tab and ctrl+r was simple enough to not warrant a lengthy search trying to find the auto-refresh fix lol.

But I will look into those links you provided. I'm not yet into the preprocessors but, you know, before I know it lol.

Thanks!

huckleberry
huckleberry
14,636 Points

Just got an upboat on this a year later. Hmm. Forgot about this thread and the mini discussion about live reload. I never used mixture.io but I see that it's now defunct.

I just wanted to chime in and mention live-server for node. The instructions are on there and it's a cake walk.

If you're not familiar with node, doesn't matter. Just install node anyway as eventually you'll get around to it but until then you can at least use it for live-reload capabilities.

If you're not familiar with the command line or don't have some sort of bash/cygwin/whatever and you have no clue what I'm talking about... well, sorry. Go watch console foundations, then git foundations, install git, and then install node, then use the gitbash to install live-server.

It's sweet!

Cheers,

Huck - :sunglasses: