FizzBuzz: (score: 71) i1^] qaYp CTRL+a q98@aggjjqaA Fizz^] 3jq32@agg:5 ENTER qaA Buzz^] 5jq19@a:%s/z B/zB/ ENTER ZZ
VimGolf.com - real Vim ninjas count every keystroke
81–86 of 86 posts
[deleted]
Re: VimGolf.com - real Vim ninjas count every keystroke
#82FizzBuzz: (score: 71) i1^] qaYp CTRL+a q98@aggjjqaA Fizz^] 3jq32@agg:5 ENTER qaA Buzz^] 5jq19@a:%s/z B/zB/ ENTER ZZ
You can achieve even less key strokes if you have your vim automatically removes trailing spaces, which is a neat feature itself and a common hack.
autocmd BufWritePre * :%s/\s\+$//
53 is the least I got.
Re: VimGolf.com - real Vim ninjas count every keystroke
#83Re: VimGolf.com - real Vim ninjas count every keystroke
#84Earlier quoted context omitted.
Sadly, that's not allowed :(
Which kind of defeats the purpose. I use Vim plugins to reduce my keystrokes.
I agree that all users rely on plugins for doing real work. However, seeing how much can be accomplished by using just vanilla features can be enlightening.
Re: VimGolf.com - real Vim ninjas count every keystroke
#85Here's my Flodder Challenge ( http://vimgolf.com/challenges/4d1a4f2ba860b744720000bf ) solution: ~wqave~2wq@aw2@ab~ws**^]l~fe~ww@afg@aZZ (where ^] is an esc). Currently gets a score of 41 (although I only count 38 keystrokes...)
[deleted]
Re: VimGolf.com - real Vim ninjas count every keystroke
#86Only scored a 27 on the 'Reverse characters in a line' challenge...
I was trying to do this:
:s/./&\r/g|g/^/m0|j!
However, that causes a to be before b for some reason.So I ended up doing:
:s/./&\\r/g|g/^/m0\rV}gJ
Anyone know why appending j! joins everything correctly except a and b?