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 9v00672c1db90000000005ba

Fix the git merge conflicts

Solve the merge conflicts in the Python file

Start file
<<<<<<< HEAD
def calculate_total(items):
    """Calculate total price of items with 10% discount"""
    total = sum(item['price'] for item in items)
    return total * 0.9  # Apply 10% discount
=======
def calculate_total(items):
    """Calculate total price of items with tax"""
    total = sum(item['price'] for item in items)
    return total * 1.15  # Apply 15% tax
>>>>>>> feature/add-tax

def format_currency(amount):
<<<<<<< HEAD
    """Format amount as USD"""
    return f"${amount:.2f}"
=======
    """Format amount as EUR"""
    return f"€{amount:.2f}"
>>>>>>> feature/currency-update

def process_order(items):
    total = calculate_total(items)
<<<<<<< HEAD
    return {
        'status': 'success',
        'total': format_currency(total),
        'items_count': len(items)
    }
=======
    shipping = 5.99 if total < 50 else 0
    return {
        'status': 'processed',
        'total': format_currency(total + shipping),
        'shipping': shipping
    }
>>>>>>> feature/shipping
End file
def calculate_total(items):
    """Calculate total price of items with tax"""
    total = sum(item['price'] for item in items)
    total = total * 0.9  # Apply 10% discount
    return total * 1.15  # Apply 15% tax

def format_currency(amount):
    """Format amount as EUR"""
    return f"€{amount:.2f}"

def process_order(items):
    total = calculate_total(items)
    shipping = 5.99 if total < 50 else 0
    return {
        'status': 'processed',
        'total': format_currency(total + shipping),
        'items_count': len(items),
        'shipping': shipping
    }

View Diff

1d0
< <<<<<<< HEAD
3,7d1
<     """Calculate total price of items with 10% discount"""
<     total = sum(item['price'] for item in items)
<     return total * 0.9  # Apply 10% discount
< =======
< def calculate_total(items):
9a4
>     total = total * 0.9  # Apply 10% discount
11d5
< >>>>>>> feature/add-tax
14,17d7
< <<<<<<< HEAD
<     """Format amount as USD"""
<     return f"${amount:.2f}"
< =======
20d9
< >>>>>>> feature/currency-update
24,30d12
< <<<<<<< HEAD
<     return {
<         'status': 'success',
<         'total': format_currency(total),
<         'items_count': len(items)
<     }
< =======
34a17
>         'items_count': len(items),
37d19
< >>>>>>> feature/shipping

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 58 remaining solutions by signing in and submitting your own entry
#59 Badita Marin-Georgian / @GeorgianBadita - Score: 765 - 11/19/24 @ 22:27
d6ji<Esc>ud5jkjjjjddjd:10<CR>ujddddddddkkjjjjddjjjddddddddddddddjjjjjjddjkkkkkkkkkkkkkOtotal = total )<BS>* 0.9 # Plly<BS><BS><BS><BS>Apply 10% dic<BS>scount<Esc>i<Esc>hhhhhhhhhhhhhhhhhhi<BS>  <Esc>;w<CR>Gfgg<Esc>ggdG<50-53>def calculate_total(items):<CR>    """Calculate total price of items with tax"""<CR>    total = sum(item['price'] for item in items)<CR>    total = total * 0.9  # Apply 10% discount<CR>    return total * 1.15  # Apply 15% tax<CR><CR>def format_currency(amount):<CR>    """Format amount as EUR"""<CR>    return f"<0xe2><0x82><0xac>{amount:.2f}"<CR><CR>def process_order(items):<CR>    total = calculate_total(items)<CR>    shipping = 5.99 if total < 50 else 0<CR>    return {<CR>        'status': 'processed',<CR>        'total': format_currency(total + shipping),<CR>        'items_count': len(items),<CR>        'shipping': shipping<CR>    }<Esc>[201~<Esc>;<Esc>l<Esc>;<Esc><Esc>;:w<CR>:q<CR>

0 comments


Created by: @pacuna

59 active golfers, 207 entries

Leaderboard (lowest score wins):
36
#1 - Danilo J. S. Bellini 🥊🇧🇷 / @danilobellini

11/11/2024 at 06:24PM

36
#2 - Peppa Pig / @PeppaPigSg

11/12/2024 at 12:48AM

36
#3 - John Braxler / @braxler

11/13/2024 at 03:15PM

37
#4 - rike09 / @rike09

11/11/2024 at 11:21PM

38
#5 - Gatsby76(Sloan Yang) / @Sloan-Yang

05/09/2025 at 08:39AM

39
#6 - ldmnt / @ldmnt

01/02/2025 at 01:37AM

39
#7 - Herschel / @herschel-ma

01/05/2025 at 01:09PM

42
#8 - MartnRamtin / @MartnRamtin

12/30/2024 at 02:10PM

42
#9 - Robert Gu / @ArchWand

05/23/2025 at 06:47PM

43
#10 - jimmymills / @jimmymills

05/09/2025 at 09:16PM

43
#11 - phaym / @phaym

05/16/2025 at 01:32AM

44
#12 - ProGamerYeet / @ProGamerYeet

11/09/2024 at 10:20PM

44
#13 - Oleksii Sanin / @AlexSanin

11/16/2024 at 03:58PM

44
#14 - ShookerAndBeta / @Shooker2012

11/21/2024 at 09:02AM

44
#15 - myu-innocence / @myu-innocence

12/21/2024 at 12:54PM

45
#16 - dejam2007 / @dejam2007

12/29/2024 at 02:14PM

45
#17 - Hessesian / @Hessesian

06/03/2025 at 08:42PM

46
#18 - ElectrifyPro / @ElectrifyPro

05/18/2025 at 11:03PM

50
#19 - Sebastian Caicedo / @jsebdev

04/20/2025 at 04:27AM

50
#20 - winter-loo / @winter-loo

05/25/2025 at 08:30PM

50
#21 - Gibson Starkweather / @boaf

05/27/2025 at 07:10PM

51
#22 - iantalks / @iantalks

11/28/2024 at 04:46PM

53
#23 - Goonoo Kim / @goonookim

11/14/2024 at 06:33AM

53
#24 - Fredrik Robertsen / @fredrikr79

11/15/2024 at 02:43PM

54
#25 - Siarhei Akhramenia / @dbzix

04/20/2025 at 03:06AM

54
#26 - abgalphbetz / @abgalphabetz

04/21/2025 at 02:05PM

54
#27 - Damien Baldy / @dbaldy

05/19/2025 at 12:25PM

54
#28 - Frank Benoit / @frankb_stgt

05/24/2025 at 06:35AM

55
#29 - Michael Cuffaro / @maiku1008

11/09/2024 at 08:09PM

55
#30 - Janusz Spatz / @janusz-anue

03/14/2025 at 09:44PM