ネタなのでスルーしてください。
昔作った、プラグインです[(begin)-(end)]
の部分を連番に展開します。ExpandSerialNmuber.vim
こんなのとか
素敵な素材画像のDLとか(今気づいたけど、これじゃ上書きされちゃいますね…)
後方参照的なこととか、計算もできます(evalに投げてるだけですが)
さて、
0-65535に正規化されたSinθを1/1024ステップでの1/4周期分、2進数で表示したいことってよくありますよね!
それ1行でできます!
[substitute(substitute(substitute(substitute(substitute(substitute(substitute(substitute(substitute(substitute(substitute(substitute(substitute(substitute(substitute(substitute(printf("%04x",float2nr(pow(2,16)*sin([0-1023]*0.5*3.141592/1024.0))),"0","0000","g"),"1","0001","g"),"2","0010","g"),"3","0011","g"),"4","0100","g"),"5","0101","g"),"6","0110","g"),"7","0111","g"),"8","1000","g"),"9","1001","g"),"a","1010","g"),"b","1011","g"),"c","1100","g"),"d","1101","g"),"e","1110","g"),"f","1111","g")]
vimで16進数→2進数の変換が分からなかったのでベタ書きしちゃったw
おわりに
個人的には頻繁に使ってるんですが、欠点はソースコードが酷いこと