Saturday 28 April 2012

VIM Tutor

Day three of my vim quest and I actualy starting to dive into using it! Vimtutor is a little command that starts up a tutorial that walks you through VIM. I know I’m supposed to be doing one thing per day on my 30 days of vim, but I’m going to work through each section of the tutorial each day until I’ve completed it.

Lesson 1 of VIM tutor

Below are my thoughts from each example from the first lesson of VIM tutor.

1.1 Moving the cursor

I’d already commited to using the vim movement keys to navigate and in yesterdays day of vimquest I’d explicitaly disabled the arrow keys. What’s weird is that whilst they’re disabled when using vim normally, when I enter vimtutor they appear to work again.

I don’t normally go in for the gamifcation of learning stuff, but I did stumble accross this delightful piece of creative learning earlier this week. It’s called Vim Adventures and it’s great way of learning the vim movements as well as a few basic commands.

Needless to say I’m finding the movement a little hard to get used to, but I’ll obviously get better at it!

1.2 Exiting VIM

In the ten years that I’ve been using vim to edit config files on servers, I’d already become adept at exiting vim.

1.3 Deleteting Text

In my basic working knowledge of using VIM I’d never really used the x key to delete text. Instead I’d normally always just entered insert mode and pressed backspace. The x key makes sense

1.4 Inserting Text

This is where I start to slow down with VIM. Popping in and out of insert mode is where I find I lose a fair bit of time. Will I get used to this or will I get quicker at it? Time will tell. Either way I was already familiar with insert mode, but it’s just getting quick at it that seems to be the problm.

1.5 Appending Text

I knew about appending text, but I have hardly ever used it. Perhaps this is one of the ways that I can speed up using VIM. I for insert and A for append - easy peasy to remember, I just have to get used to using each in context.

1.6 Editing a File

I’m already super cool with editing files, but I didn’t know how to do a save as type command, so I took a stab in the dark - I was correct –

 :w $HOME/Desktop/vimtutor-1.txt 


I guess I just have to keep using what I’ve learned and start using VIM as the default editor when loading up new projects. However, I’ll have to set up some file specific defaults ( soft indents for python files and normal tabs for css, html and js) and sort out syntax highlighting.

I think I’ll do this tomorrow along with the next lesson from VIM tutor - Deletion commands.