Real Vim ninjas count every keystroke - do you?

Pick a challenge, fire up Vim, and show us what you got.

Changelog, Rules & FAQ, updates: @vimgolf, RSS.

Your VimGolf key: please sign in

$ gem install vimgolf
$ vimgolf setup
$ vimgolf put 5c1db460c5949f000990a2f1

My cafe needs a new menu

Help! My cafe needs a new menu and I've only got this plain-text file from the kitchen. In order to get it printed, I need to transform it into a markdown file with; headings for each type of item, prices on each menu item, dietary options and a key down the bottom.

Start file
mocha drink 4
tea drink 3
iced-tea drink 5
iced-mocha drink 5
eggs-on-toast breakfast gluten-free-option,vegetarian 14
bacon-and-eggs breakfast 16
vegan-deluxe breakfast gluten-free-option,vegetarian 14
meaty-deluxe breakfast 20
big-burger lunch gluten-free-option,vegetarian-option 14
steak-and-chips lunch 22
End file
# Drink
- Mocha - $4
- Tea - $3
- Iced Tea - $5
- Iced Mocha - $5

# Breakfast
- Eggs On Toast (GFO,V) - $14
- Bacon And Eggs - $16
- Vegan Deluxe (GFO,V) - $14
- Meaty Deluxe - $20

# Lunch
- Big Burger (GFO,VO) - $14
- Steak And Chips - $22

> *GFO = Gluten Free Option, V = Vegetarian, VO = Vegetarian Option

View Diff

1,10c1,17
< mocha drink 4
< tea drink 3
< iced-tea drink 5
< iced-mocha drink 5
< eggs-on-toast breakfast gluten-free-option,vegetarian 14
< bacon-and-eggs breakfast 16
< vegan-deluxe breakfast gluten-free-option,vegetarian 14
< meaty-deluxe breakfast 20
< big-burger lunch gluten-free-option,vegetarian-option 14
< steak-and-chips lunch 22
---
> # Drink
> - Mocha - $4
> - Tea - $3
> - Iced Tea - $5
> - Iced Mocha - $5
> 
> # Breakfast
> - Eggs On Toast (GFO,V) - $14
> - Bacon And Eggs - $16
> - Vegan Deluxe (GFO,V) - $14
> - Meaty Deluxe - $20
> 
> # Lunch
> - Big Burger (GFO,VO) - $14
> - Steak And Chips - $22
> 
> > *GFO = Gluten Free Option, V = Vegetarian, VO = Vegetarian Option

Solutions

The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!

Check out these helpful resources to improve your Vim skills... Game on.

Unlock 2 remaining solutions by signing in and submitting your own entry
#3 Bennett / @bennettbackward - Score: 189 - 12/22/18 @ 10:59
<C-V>9jI- <Esc>O# Drink<CR><CR># Breakfast<CR><CR># Lunch<Esc><CR>qq/\d<CR>i- $<Esc><CR>q9@q^qqWWyy*pWWdW``ddq9@q:%s/\v(\w)(\w*)[- ,]/\u\1\2 /g<CR>o<CR>> *GFO = <Esc>3kfGct-(GFO,VO) <Esc>GA<C-R>"<C-O>FV<BS>, V = <C-O>yw<C-O>P<BS>, VO = <Esc>$x7kFGct-(GFO,V) <Esc>kkFG.ZZ

0 comments


Created by: @bennettbackward

3 active golfers, 6 entries

Leaderboard (lowest score wins):
151
#1 - Filipe Brandenburger / @filbranden

07/08/2019 at 04:57AM

157
#2 - tPenguinLTG / @tpenguinltg

12/23/2018 at 05:50AM

189
#3 - Bennett / @bennettbackward

12/22/2018 at 10:59AM