Tuesday, August 25, 2009

Re: Suggest a vim task for a college workshop

I think most suggestions here are missing the point.

You will NEVER get students to use Vim without communicating two
important things:

1. Vim is a very powerful tool with plenty of advantages over other
tools.
2. Vim is complex, but there are ways to learn how to use it
effectively.

I was given a similar tutorial of emacs in one of my college courses,
and I thought it was ludicrous that anyone would ever use it by
choice, but only because I was never shown the power of the editor or
any reason behind the complexity (or an easy way to find help).
Therefore, I never used it, and it was not until my final year that I
actually saw someone using it to its full potential and said, "wow,
that's neat, I wish someone had shown me THAT". Notepad++ was still
easier for me to use and (in my mind) plenty powerful. It wasn't until
I saw one of my friends using Vim and navigating through a complex
call tree with only a few keystrokes that I decided to give Vim a
shot, and never went back.

With this in mind, I would suggest the following instead:

The tutorial will consist of three steps:

1. Write a simple C program, with compile errors or warnings
intentionally inserted
2. Compile the C program within Vim
3. Correct the errors and compile and run the program

Start them out with a pre-configured Vim with a lot of "bells and
whistles" such as syntax highlighting already enabled for them. Maybe
even install a snippet or skeleton plugin that pre-populates most of a
C program for them. TagList would not be out of the question.

In front of them, on a projector screen if possible, show them what
you want them to do making sure to point out things like completion
and text objects. Write a C program and have them follow along, or
have them write it in steps after telling them the basics like how to
enter/leave insertion mode and then do the step yourself using more
advanced commands to point out the easier way to do it.

Then, issue a :make command (the tutorial setup should allow this,
whether by setting the appropriate 'makeprg' option or providing a
premade makefile). Be sure to point out that it jumps to the first
error. "Now what?" you might ask. The next step may be the most
important part of the tutorial: bring up :help :make and point out:

1. you can now go to the next error with :cnext
2. you can prevent jumping to the first error using :make! instead
of :make
3. Vim's help tells you basically EVERYTHING you need to know about
the editor.

This step is VERY important. Without knowledge of :help, Vim is
basically useless, and a new user will never get beyond basic editing.
If time permits, I would even demonstrate CTRL-D with a :help topic,
and :helpgrep.

At this point you've shown some of the power of Vim, but many students
will be thinking, "Whatever. My IDE can do that, and I can see a list
of all the errors." So, show them what :copen does.

Make sure one of the coding errors/warnings is something you can use
to demonstrate some of Vim's features that AREN'T in common point-and-
click editors. For example, you could show them text objects or the
"surround" plugin or a spelling typo in the name of a struct field
that occurs with multiple object names so it requires a VERY SIMPLE
regular expression to fix (regular expressions CANNOT be demonstrated
to any satisfactory level in a 30-minute session).

End the tutorial by giving them a reference sheet with information
about how to get started on their own, including:

:help references for the tutorial, for the index/table of contents,
for the .vimrc, etc.
The Vim home page: http://www.vim.org
The Tips wiki: http://vim.wikia.com (possibly even the "Getting
started" category: http://vim.wikia.com/wiki/Category:Getting_started)
The URL for this mailing list: http://groups.google.com/group/vim_use
A location (preferably a network share, though an email address will
probably do) where they can get a copy of the Vim setup used in the
tutorial session.

That's my take, anyway. Good luck!
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

No comments: