VimGolf in Emacs 023: Before there was Farmville… (by Tim Visher)
VimGolf in Emacs 023: Before there was Farmville… (by Tim Visher)
VimGolf in Emacs 022: Assignment Alignment
The Challenge
line up the operators. Use spaces, not tabs.
Features Shown
C-x h - The mark-whole-buffer function.align-regexp function.VimGolf in Emacs 021: Promote that perl ‘one-liner’…
This one’s pretty boring, I’m not gonna lie. But here we go nonetheless.
The Challenge
You’ve just sorted your data using perl -e, when suddenly you have to add a row and do it again. That’s twice - you’ll almost certainly do it again. Time to turn it into a real script. We’ll start from having pasted it in …
Features Shown
VimGolf in Emacs 020: Overall Vimgolf Rank
The Challenge:
Suppose you are trying to figure out what your overall rank is at Vimgolf(the sum of all the ranks you got), and as a Vim ninja you decided to use Vim to do the job. Your solution should work for every Vimgolf profile page(The actual input file for this challenge is my Vimgolf profile page). So, direct answer insertion is considered cheating.
Features Shown:
C-e - the move-end-of-line functionM-4 ... - Command repetitionM-b - the backward-word functionM-d - the kill-word functionM-2 C-S-backspace - the kill-whole-line functionM-2 C-y - the yank function with the kill ringC-o - the open-line functionM-< - the beginning-of-buffer functionC-x * : - Reducing a calc vector using a functionC-u y - the calc-copy-to-buffer function with an argumentVimGolf 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:
M-3 <f4> - Command repetitionM-d][md] - The kill-word function.M-b - The backward-word function.C-S-backspace - The kill-whole-line function.C-e][c-e] - The end-of-visual-line function.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:
append-to-buffer functionM-1 8 * - repeating keys with numeric argumentsC-x f 18 - set fill column for center lineM-o M-s - the center-line function<insert> - overwrite-modeC-x r k - the kill-rectangle functionVimGolf in Emacs 017: HTML to Haml
The Challenge:
Help convert this HTML page to Haml.
Features Shown:
One of the keys here is the idea of multi-passing a file. This keyboard macro does that
Don’t forget that maybe the easiest way to write a function in emacs without learning a lick of elisp is <f3> ... <f4> C-x C-k n ... C-x C-f .../init.el RET M-x insert-kbd-macro ... RET. Anything you know how to do in the editor can be available always through this!
query-replace-regexp functionflush-lines functionwhitespace-cleanup functionM-x flush-lines RET ^ *$ RET