Reputation: 222188
Just found about the autocomplete feature in Sublime Text 2.
Example auto complete file:
{
"scope": "text.html - source - meta.tag, punctuation.definition.tag.begin",
"completions":
[
{ "trigger": "a", "contents": "<a href=\"$1\">$0</a>" },
{ "trigger": "abbr", "contents": "<abbr>$0</abbr>" },
{ "trigger": "acronym", "contents": "<acronym>$0</acronym>" }
]
}
I tried to search for a similar thing for Vim, but haven't been able to find anything.
Does anything like this exist for Vim? Preferably if it uses simple to generate format, like JSON, YAML, etc.
Upvotes: 4
Views: 3310
Reputation: 12413
Did you try neocomplcache or autocomplpop? They seem to do what you want.
Upvotes: 0
Reputation: 31
A more recent alternative to SnipMate seems to seems UltiSnips, I haven't tried it myself though.
There is also vim's built in abbreviations support, but I don't think they support anything more complex than expanding a short text to a longer text. Still quite useful though.
Upvotes: 3
Reputation: 41934
I think you are looking for SnipMate, a good tutorial from Jeffrey Way: Vim Essential Plugin: SnipMate
Other plugins that can do something like you want: SparkUp or Zen Coding.vim
Upvotes: 4