Created
December 29, 2010 19:51
-
-
Save jsjohnst/758974 to your computer and use it in GitHub Desktop.
Sample .vimrc to solve one of the #vimgolf challenges
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:set compatible | |
let @y=':g/./|s/{/(/|s/}/)/|s/\[\S$/{/|s/^]/}/|s/(\S$/{/|s/)\S$/}/^M' | |
let @z=':2g/./|s/(/[/|s/)/]/^M' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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