smartchr を入れた


smartchr を入れた。元ネタと同じ設定をしてみた。

autocmd FileType actionscript,javascript inoremap <buffer> <expr> = smartchr#one_of(' = ', ' == ', ' === ', '=')

例えば

function hoge() {
var foo
}

foo の直後に = を入力すると

function hoge() {
var foo=
}

とならずに

function hoge() {
var foo =
}

となる。さらに続けて = を入力すると、引数に設定した文字に次々に切り替わる。

カテゴリー: Vim   パーマリンク

コメントをどうぞ

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

*

次のHTML タグと属性が使えます: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>