문제

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.

도움이 되었습니까?

해결책

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

다른 팁

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.

Did you try neocomplcache or autocomplpop? They seem to do what you want.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top