この記事は Vim Advent Calendar 2013 91日目の記事になります。 みなさんは, 変数を hoge() で囲みたくなることはありませんか. 私の場合は必要になる hoge の種類が少ないので, vimrc に surround の設定を追加して対応していました. b:surround_{char2nr("a")} = "hoge(\r)" これだとドットの公式も使えるし, サクサク hoge() で囲えるわけです. でも, 不満が2点あって, 囲みたい対象が配列や関数な形式のときはどうすんべ たまに hage でも囲みたいときがあるけど, vimrc に追加するのは面倒 そこで毎度の lingr で聞いてみました. (以下抜粋+勝手加工) syngan v[123] みたいなのを hoge(v[123]) と hoge() で囲うをたくさんやりたいのですが この操作に
wildfire.vimという、カーソルがある辺りのテキストオブジェクトをなんとなく選択してくれるVimプラグインを使い始めた。Vim力が下がる代わりに魂の平穏が得られる。ような気がする。 デフォルトではノーマル・モードで<Enter>を押すとカーソルのある辺りのテキストオブジェクトを選択してくれる。HTMLファイルを編集中なら属性値の上で発動させると、クオートの間を選択してくれる。その状態でもう一回<Enter>を押すとその上位にあるテキストオブジェクトをなんとなく選択してくれる。属性値のクオートの間を選択した状態だと、HTMLタグで括られた全体(など)まで拡大される。 逆方向に縮小することも出来るので、適当にタカタカ<Enter>を押して拡大しつつ、広げ過ぎたら<BS>で狭めるみたいな感じで使えて、とてもいい加減に使える。僕は狭める方だけを<S-Enter>に変えて、サクサク感を上乗せ
この記事は Vim Advent Calendar 2012 233日目の記事になります。 一昨日からメインのマシンが起動しなくなりましたが、わたしは元気です。 さて、前回は textobj プラグインをまとめてみました。 ご覧の通り textobj プラグインはたくさんあり、これを使い分けるのは大変ですし、使用するマッピングするキーもどんどん枯渇していきます。 そこで複数の textobj を1つにまとめ、抽象的に使用できるような textobj をつくりました。 この textobj を使用する事で設定した複数の textobj から最初にマッチした textobj を使用します。 要は文脈によって使用する textobj が変わるような感じです。 コンセプトとしては textobj-multiblock と似ています。 [インストール] osyo-manga/vim-textobj-
この記事は Vim Advent Calendar 2012 229日目の記事になります。 最近やっと textobj を利用し始めた情弱な Vimmer なんですが、どんな textobj があるのか知らなかったので調べられる範囲でまとめてみました。 基本的に kana さんの vim-textobj-user を使用しているプラグインを上げてあります。 ご覧の通り量が多いので typo などがあったらごめんなさい(・ω<) [textobj 一覧] プラグイン 範囲 マッピング 備考 user entire バッファ全体 ae, ie line カーソル行 al, il 参照 function 関数内 af, if syntax シンタックス ay, iy jabraces 「foo」 or 【bar】など ajb, ijb lastpat 最後に検索されたパターン a/, i/ in
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く