callmekohei's blog

callmekoheiのひとりごと

Vimの操作を効率的に学ぶための6つのエクササイズ〜

ぜんぜん足りないとはおもいますけど

vimの操作の勘所をエクササイズ形式で

まとめてみました〜 (^_^)/

01

extragrouptexts

↓

extraGroupTexts

hints

f find

~ large letter / small letter

02

abc

↓

bbc

↓

BBC

hints

r replace

viw select word

~ large letter / small letter

03

{apple}"banana"<cherry>{APPLE}"BANANA"<CHERRY>

hints

vi{ select inside {}

~ large letter / small letter

04

.btn-large {
    padding     : 12px 19px ;
    font-size   : 16px      ;
    line-height : normal    ;
    font-weight : bold      ;
}.btn-large {
    font-size   : 16px      ;
    font-weight : bold      ;
    line-height : normal    ;
    padding     : 12px 19px ;
}

hints

vi{ select inside {}

:'<,'>sort sort

05

let abc = {


}let abc = {
    
    }

hints

v(line number)G $ select

shift > indent

06

let Say ( sq:seq<string> ) : unit =
   sq |> Seq.iter stdout.WriteLine

let threeTimes word =
   Seq.init 3 ( fun _ -> word )

threeTimes "hello" |> Say

↓

let threeTimes word =
   Seq.init 3 ( fun _ -> word )

let Say ( sq:seq<string> ) : unit =
   sq |> Seq.iter stdout.WriteLine

threeTimes "hello" |> Say

hints

vjj select

:'<,'>m 6 move


練習用テキスト

( ex1 )
extragrouptexts


( ex2 )
abc


( ex3 )
{apple}"banana"<cherry>


( ex4 )

.btn-large {
    font-size   : 16px      ;
    font-weight : bold      ;
    line-height : normal    ;
    padding     : 12px 19px ;
}


( ex5 )

let abc = {


}

( ex6 )

let Say ( sq:seq<string> ) : unit =
   sq |> Seq.iter stdout.WriteLine

let threeTimes word =
   Seq.init 3 ( fun _ -> word )

threeTimes "hello" |> Say