Sublime Forum

Coda-style Auto Completion in Sublime Text 2

#1

Hi All,
Due to the abysmal release of Coda 2, I have made it my Mid-May resolution to start using ST2 full time. However, there are a few things I’m so used to in Coda, and I’m wondering if it’s possible to replicate them in ST.
The auto-complete in Coda, having worked with it for god knows how many hours per day for years, is just what I’m used to and I think the way it suggests properties for HTML tags is the “best” way to do it.

Part one of what I’d like to replicate is that if you type <div and then a space it will suggest class, id, contenteditable, rel, alt, etc… Basically the list of properties for that tag.
Is there a way to do that in ST2? I’ve read that you can do div.classname and hit tab to make

but that doesn’t work for me, I just sit there hitting tab like a weirdo. For adding hrefs, classes, and IDs to anchors I think the Coda-style saves a lot of time.

Second part of what I’d like to replicate is how if you type
, it auto completes it as
. I realize not everyone wants that, but I’m wondering if anyone has been able to port that over to Sublime.

Thanks very much for any help!

0 Likes

#2

Do you know zen coding?

0 Likes

#3

@stovetop I don’t use autocompletion myself, relying on ZenCoding for writing HTML. This provides the functionality you describe at the end of your post. ZenCoding is a separate plugin, which you can install via Package Manager (wbond.net/sublime_packages/package_control).

More about ZenCoding: code.google.com/p/zen-coding/

Hope this helps,
Alex

0 Likes

#4

There are a couple packages availble on Github that can do this:

github.com/SublimeText/Tag

github.com/kihlstrom/CloseTagOnSlash

0 Likes

#5

Hi stovetop,

I recently started using Sublime Text, having used Coda v1 for the last few years, and I’m in the same boat as you. I’ve been looking at Sublime text, mostly because of recommendation, but also because of additional features. Like you, I’m really disappointed in the code suggestion (in this case ‘auto complete’) feature. It just doesn’t have the same fluidity Coda did, but in the spirit of going ‘all-in’ on learning Sublime Text, Zen-coding (ZC) has helped me fill this gap to some extent. It is frustrating at times having to ‘reference’ the ZC cheat-sheet but I have found myself code 10x fast and wonder why it took me so long to find out about ZC.

All that being said, I do think Sublime should look into fixing/updating how their auto-complete works. I would rarely use it now using ZC but it is important to give coders the option. I had to turn auto-complete off using ZC because I would type ‘bg’ and the auto-complete would give me (for whatever reason) background-color: rgb (255, 255, 255, 0); as the first option instead of just background: ;. So just bare with it and keep your fingers crossed for it. That and a color theme that reflects the look of Coda’s default colors (still haven’t found one that reflects this having grown so used to it).

0 Likes