Getting started with Sublime Text
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 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
Basically what you've done is that you've told Sublime Text that the language you're typing is HTML. The
sshtml means set syntax (I knew this).
<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:
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>