Showing posts tagged keyboard macros

VimGolf in Emacs 023: Before there was Farmville… (by Tim Visher)

VimGolf in Emacs 019: Rotating Philosophers Problem

The Challenge:

Can you help the philosophers find a good place to sit before they get five forks and spaghetti?

Features Shown:

VimGolf in Emacs 018: categorize the shopping list

The Challenge:

Going to the store with an unorganized shopping list is like programming with Notepad. Help the shopper efficiently navigate the aisles to avoid unnecessary footsteps.

Features Shown:

VimGolf in Emacs 015: imports alignment (python)

The Challenge:

Align as one import per line.

Features:

VimGolf in Emacs 014: Remove duplicate items

The Challenge:

Input is a list of numbers. Produce a set of unique numbers from input.

Features Shown:

VimGolf in Emacs 011: Numbering a List

Features Shown

  1. Keyboard Macros and the Counter (see e005)

VimGolf in Emacs 010: Make a PHP Template from a static HTML file

Features Shown

  1. Keyboard Macros
  2. Regexp Search/Replace (bang for rest)
  3. isearch movement
  4. Breadcrumbs
  5. find-file-literally
  6. Using C-e C-f rather than C-n C-a in your macro definition to avoid wrapped line problems.
  7. back-to-indentation M-m
  8. newline-and-indent C-j vs. <enter>
  9. redefining kmacro-edit-lossage to reference ‘view-lossage rather than any specific key-sequence. (HT sword on #emacs)

Learn You A Keyboard Macros For Great Good: A VimGolf in Emacs Supplemental

I wanted to take a quick break today from our usual programming and turn instead to a challenge that I stumbled upon while getting organized for the next few iterations of the VimGolf In Emacs series.

I figured the deviation was worth a quick post accompanying the video.

For each VimGolf in Emacs video I do a few things:

  1. I copy the text of the challenge out into 4 files:
    1. A presentation file for later editing and inclusion with the video and this blog.
    2. A start file with the starting text that I don’t edit and thus am able to restore from if I make any horrible mistakes.
    3. A work file in which I do my work.
    4. An end file to which I compare the results of my work which I don’t edit.
  2. I create 3 tasks in Remember The Milk: Research, Record, and Publish. Each is tagged @web, located at home, and has the short url that I created attached to it for easy reference.

I’d done this enough times that I was convinced I should be able to do it with a Keyboard Macro. What you see here is the result.

I’m pretty darn impressed! ^_^

Anyway, the main features I use, other than Keyboard Macros, are:

  1. append-to-file
  2. append-to-buffer

Hope you enjoy!

Oh, and I would definitely click through and watch this full size, as I recorded it at 1280x800 rather than the usual 800x600.

Learn You A Keyboard Macros For Great Good: A VimGolf in Emacs Supplemental from Tim Visher on Vimeo.