Skip to content

Getting started with Sublime Text

Ansh Sharma edited this page Jun 16, 2017 · 5 revisions

The beauty of this editor is the variety of shortcuts it has to offer. Let's not waste time. There's this way to just open up Sublime Text and get started with coding; and then, there's this way which is likely to be beneficial in the future so let's stick with the latter.

Create a folder

Websites have their own separate folder. This makes searching and uploading files to the server easy, and helps us to be organised. So first create a new folder. I'm creating a folder named ansh. Next, open Sublime Text and do this:

File menu > Open Folder...

Browse and open your new folder and you're done. Remember this step.

Create the file index.html

index.html will be the main file of the website. A front page sort of thing, it's called the homepage. Now, I'm sure you remember the old school typing <html>... and so on. We won't type it manually, we'll ask Sublime Text to type it. Here's how:

Press Ctrl+Shift+P. A small box opens up. It's called Command Palette (I didn't know it's called that, I had to look that up just to tell you). Type sshtml.

Basically what you've done is that you've told Sublime Text that the language you're typing is HTML. The ss in sshtml means set syntax (I knew this).

Now type <h (you don't even need to type html, just type h. As soon as you do that, you'll see a menu like this:

Screenshot

Press Tab two times and see the magic!

Finally, put something between the title tags and the body tags and save the document as index.html in your folder.

Why don't we match our files? My index.html after doing all this looks like this:

<!DOCTYPE html>
<html>
<head>
	<title>My good ole webpage</title>
</head>
<body>
	Hello, I'm Ansh Sharma. Welcome to my website :-)
</body>
</html>

Read more:

Setting up advanced features in Sublime Text →

You can’t perform that action at this time.