Saturday, October 5, 2013

Lesson 25 - Birds in Insert Mode

Today I suggested we do some stuff with files but she wanted to use vim and create a new file containing bird species. First we had a look at the quite impressive list of files we had already created, by using ls. She wanted to see what's inside the "vkp" file and used cat to print out the file contents. She had some difficulty remembering cat, but with some tips she remembered it and was able to type it correctly. So, we saw the Finnish weekdays listed in the "vkp" file.

    maanantai tiistai keskiviikko torstai perjantai lauantai sunnuntai
    maanantai tiistai keskiviikko torstai perjantai lauantai sunnuntai
    maanantai tiistai keskiviikko torstai perjantai lauantai sunnuntai
    maanantai tiistai keskiviikko torstai perjantai lauantai sunnuntai
    maanantai tiistai keskiviikko torstai perjantai lauantai sunnuntai
    maanantai tiistai keskiviikko torstai perjantai lauantai sunnuntai
    maanantai tiistai keskiviikko torstai perjantai lauantai sunnuntai
    maanantai tiistai keskiviikko torstai perjantai lauantai sunnuntai

Then she wanted to jump to Turtle Roy, but I insisted we make the bird file first. And so we did. Her writing is improving all the time and she typed "vim linnut" almost without errors. The double consonant nn was the only part where she needed help.

Then with some help she got into insert mode and typed, mostly unhelped the two birds that came into her mind:

    varis harakka:

Oops! She had forgot she had to exit insert mode before using :wq to exit. But the cool thing was that she noticed her error immediately, pressed esc (exit insert mode) and was starting corrective actions by herself when I interrupted her and wanted to know what she was going to do. She said 

    "I'm gonna enter insert mode and delete that colon". 

Pow! I said that's very good, but there's an even easier way to do that. Just type x to delete the character at the cursor. So she did that, then save and exit.

I suggested we have the computer speak the new file but she wanted to have it speak the "vkp" file instead. And indeed she did that. Without any help.

    cat vkp|say

That's it for today! Now, bedtime.

1 comment:

  1. That the first thing she thought of was entering insert mode to erase a character (which btw won't work in some versions of vi!) is kind of indicative that direct editing is more intuitive than all that modality. Using specialized one-key commands / shortcuts instead of the intuitive longer route is indeed an acquired taste.

    ReplyDelete