Sublime Forum

Sublime text 3 code layout

#1

Hey guys, was wondering if you could help me out…
I’m new to sublime - My code layout doesn’t look right; all my code is staying to the far left next to the numbers and not spacing out when I go down a line to the right like I’ve seen it on tutorials etc. Is something wrong? Thanks :slight_smile:

0 Likes

#2

Which programming language are you writing?

0 Likes

#3

Just basic html

0 Likes

#4

Tropical, (assuming no specific add-ins) the editor will not recognise HTML, even as you type <html>, until the file is named (saved). As soon as you save it (as xyz.html) syntax highlighting comes into effect. Unlike (say) Python, HTML does not have indent rules, and comparing various corporate HTML ‘style guides’ will yield a multiplicity of ideas saying how such things should/must be done. There are ST packages which may help, depending upon your preferences for such.

0 Likes

#5

Instead of pre-saving, you could just open the command palette (Ctrl+Shift+P on windows) and type ‘sshtml’ to set the syntax for the current buffer to html. Then your syntax highlighting will work correctly, along with tab completion of common tags and enter to autoindent.

To make things even better, consider installing Emmet. It’s great :slight_smile:

0 Likes