Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there Sublime Text intellisense for HTML when editing Ruby files?

I'm enjoying Sublime Text 2 as an editor for my Ruby on Rails project, however, when I'm editing my .erb files, I'm not getting any html help.

For example, if I typed: <input type=", I would like to see a list of "text", "button", "file", etc.

I like the Visual Studio intellisense support for HTML, is there something similar for Sublime and Ruby on Rails?

like image 556
Mark Kadlec Avatar asked Aug 06 '12 21:08

Mark Kadlec


1 Answers

Sublime Text has built in intellisense for html, even when editing .erb files. It even does a fuzzy match instead of an exact substring match like most intellisense tools.

  1. Ensure your syntax is html (rails). Hit ctrl+shift+p and type Set Syntax: HTML (Rails)
  2. Hit ctrl+space whenever you'd like intellisense menu to popup

If you want intellisense to automatically popup instead of hitting ctrl+space you can modify the "auto_complete_triggers" setting in Preferences.sublime_settings. For example, if you want the intellisense to popup after you've typed < or = you'd add this to your user settings file:

"auto_complete_triggers": [ {"selector": "text.html", "characters": "<="} ]

example of sublime text intellisense

like image 122
Matt York Avatar answered Nov 01 '22 07:11

Matt York