Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to get Sublime Text 2 to autocomplete HTML attributes?

I was wondering if there is a way to get Sublime Text 2 to autocomplete HTML attributes like in Aptana?

like image 408
camara90100 Avatar asked Jun 02 '12 05:06

camara90100


People also ask

How do I enable autocomplete in Sublime Text?

By default, Sublime Text will automatically show the completions popup when a user is editing source code or markup, but not within prose in comments, strings or markups. Pressing the Esc key will hide the completions popup. To manually show the completions popup, press Ctrl+Space.

Does Sublime have IntelliSense?

Sublime has autocompletion already and there's no IntelliSense package.

How do I select HTML in Sublime Text?

You can select some text and then choose Edit > Tag > Wrap Selection with tag from the menu (or use the key binding you'll see when you look there) to do this.


1 Answers

Autocomplete is enabled by default when you use "<" and your tag and then hit enter. So if you enter <p and then hit enter it will finish out the tag pair for you... where you will end up with <p></p> and your cursor will be in the middle. You can change this to tab if you prefer by pasting the following into your Preferences -> Settings - User file:

{     "auto_complete_commit_on_tab": true } 

This will override the default value of false for completion on tab. Again that is only if you wish to use tab instead of enter.

like image 98
Valjas Avatar answered Sep 20 '22 08:09

Valjas