Skip to content

Instantly share code, notes, and snippets.

@jsjohnst
Created December 29, 2010 19:51
Show Gist options
  • Save jsjohnst/758974 to your computer and use it in GitHub Desktop.
Save jsjohnst/758974 to your computer and use it in GitHub Desktop.
Sample .vimrc to solve one of the #vimgolf challenges
:set compatible
let @y=':g/./|s/{/(/|s/}/)/|s/\[\S$/{/|s/^]/}/|s/(\S$/{/|s/)\S$/}/^M'
let @z=':2g/./|s/(/[/|s/)/]/^M'
To solve this challenge: http://vimgolf.com/challenges/4d1a522ea860b7447200010b
Use the above .vimrc and then type: @y@zZZ
Technically, you don't need two macros, but any submission with five
or less characters is falsely accused of "cheating".
"cheating" to me means tricks like pasting from the clipboard the final
answer. When you are using purely native functionality in the app which
you are challenged to knowing how to use well, then that's far from
cheating, IMHO.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment