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 by @GavinKoeng:

Unlock 19 remaining solutions by signing in and submitting your own entry
Created by: @pacuna

88 active golfers, 313 entries

Solutions by @GavinKoeng:
36
#4 - Gavin / @GavinKoeng

12/09/2025 at 03:09AM

37
#>6 - Gavin / @GavinKoeng

12/09/2025 at 03:01AM

38
#>8 - Gavin / @GavinKoeng

11/03/2025 at 03:44AM

38
#>8 - Gavin / @GavinKoeng

11/03/2025 at 03:59AM

39
#>12 - Gavin / @GavinKoeng

11/03/2025 at 03:32AM

39
#>12 - Gavin / @GavinKoeng

11/03/2025 at 03:38AM

41
#>12 - Gavin / @GavinKoeng

11/03/2025 at 03:19AM

43
#>17 - Gavin / @GavinKoeng

11/03/2025 at 03:18AM

44
#>21 - Gavin / @GavinKoeng

11/03/2025 at 03:11AM

45
#>23 - Gavin / @GavinKoeng

11/03/2025 at 03:08AM

46
#>24 - Gavin / @GavinKoeng

11/03/2025 at 03:04AM

47
#>24 - Gavin / @GavinKoeng

11/03/2025 at 02:55AM

52
#>30 - Gavin / @GavinKoeng

11/03/2025 at 02:44AM

52
#>30 - Gavin / @GavinKoeng

11/03/2025 at 02:51AM

55
#>39 - Gavin / @GavinKoeng

11/03/2025 at 02:37AM

55
#>39 - Gavin / @GavinKoeng

11/03/2025 at 02:41AM

57
#>43 - Gavin / @GavinKoeng

11/03/2025 at 02:25AM

61
#>55 - Gavin / @GavinKoeng

11/03/2025 at 02:20AM

67
#>66 - Gavin / @GavinKoeng

11/03/2025 at 02:17AM