surround.vim
()で囲んだり <p></p>で囲んだりする作業が一気に楽になるプラグイン
プラグインファイル
http://www.vim.org/scripts/script.php?script_id=1697
より入手し、$HOME/.vim/以下へ展開でOK
例
vimrc に以下を設定
その上でPHPファイルの場合
()で囲んだり <p></p>で囲んだりする作業が一気に楽になるプラグイン
プラグインファイル
http://www.vim.org/scripts/script.php?script_id=1697
より入手し、$HOME/.vim/以下へ展開でOK
例
ds :Delete surroundingsOld text Command New text
"Hello world!" ds" Hello world!
[123+456]/2 cs]) (123+456)/2
"Look ma, I'm HTML!" cs"<q> <q>Look ma, I'm HTML!</q>
if x>3 { ysW( if ( x>3 ) {
my $str = whee!; vlllls' my $str = 'whee!';
cs :Change surroundingsOld text Command New text
"Hello world!" ds" Hello world!
(123+456)/2 ds) 123+456/2
<div>Yo!</div> dst Yo!
ys :(Unfortunately there's no good mnemonic for "ys".)Old text Command New text
"Hello world!" cs"' 'Hello world!'
"Hello world!" cs"<q> <q>Hello world!</q>
(123+456)/2 cs)] [123+456]/2
(123+456)/2 cs)[ [ 123+456 ]/2
<div>Yo!</div> cst<p> <p>Yo!</p>w
Old text Command New text
Hello world! ysiw) Hello (world)!
Hello world! yssB {Hello world!}
vimrc に以下を設定
autocmd FileType php let b:surround_45 = "<?php \r ?>"
let g:surround_45 = "<% \r %>"
let g:surround_61 = "<%= \r %>"
その上でPHPファイルの場合
それ以外Old text Command New text ~
print "Hello *world!" yss- <?php print "Hello world!" ?>
Old text Command New text ~
print "Hello *world!" yss- <% print "Hello world!" %>
print "Hello *world!" yss= <%= print "Hello world!" %>
PR
この記事にコメントする
広告
プロフィール
negao (45歳 男性)
土木工学卒でなぜかSEやってます。
最近、残業代も出なくなってツライな・・・
最近、残業代も出なくなってツライな・・・
ブログ内検索
カテゴリー
カウンター
アクセス解析