2009/08/05

ViでTextmate風のsnippet入力を可能にするsnippetsEmu

Teximateにはif TABと入力するだけでif分の雛形が複数行に渡って入力されるsnippetとよばれる仕掛けがあるんだけど,snippetsEmuはそれをviで可能にしたもの.

snippetsEmu

インストール

1. ~/.vim/after/ftplugin を作る.
2. snippy_plugin.vba と snippy_bundles.vba をダウンロード.
3. vimball (.vba)をvimで開いて,それぞれ :source % を実行.
4. ~/.vimrc に filetype plugin on

使い方

トリガーとなるキーワードの続けてTABでsnippetが展開される.何が展開されるかはafter/ftpluginのファイルを参照.

Cの場合は,inc, Inc, namespace, once, main, class, struct, template, if, for, do, beginend, readfile, printf, vector, mapが定義されている.

whileないね.などというときはftpluginにc_snippet_my.vimなどのファイルを作って追加すればいい.そもそも,snippetがBSD styleなので手をいれないと.

1 件のコメント:

  1. Let’s take a look at|check out} a few of the the} top sports for sports betting. Sports betting has experienced a growth current years|in current times|lately} and one cause for this is that sports betting adds an additional element to a recreation or a sporting event. When you have have} positioned a guess, you will experience the sport 1xbet in a different way|in one other way}.

    返信削除