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 4d1ace6c142cca7133000033

Reformat some Python

Fix some very bizarrely laid-out code.

Start file
def fed(j):
    n = sum([1000000000,
              200000000,
               30000000,
                4000000,
                 500000,
                  60000,
                   7000,
                    800,
                     90,
                     j])
    print('abc'+str(n)+'def')
End file
def fed(j):
    n = 1234567890 + j
    print('abc%ddef' % n)

View Diff

2,12c2,3
<     n = sum([1000000000,
<               200000000,
<                30000000,
<                 4000000,
<                  500000,
<                   60000,
<                    7000,
<                     800,
<                      90,
<                      j])
<     print('abc'+str(n)+'def')
---
>     n = 1234567890 + j
>     print('abc%ddef' % n)

Solutions by @nickandbro:

Unlock 10 remaining solutions by signing in and submitting your own entry
Created by: @holizz

236 active golfers, 609 entries

Solutions by @nickandbro:
34
#44 - nickGPT / @nickandbro

08/29/2024 at 12:09AM

35
#>63 - nickGPT / @nickandbro

08/29/2024 at 12:09AM

36
#>70 - nickGPT / @nickandbro

08/29/2024 at 12:09AM

37
#>74 - nickGPT / @nickandbro

08/29/2024 at 12:09AM

38
#>77 - nickGPT / @nickandbro

08/29/2024 at 12:09AM

39
#>87 - nickGPT / @nickandbro

08/29/2024 at 12:09AM

43
#>133 - nickGPT / @nickandbro

08/29/2024 at 12:09AM

44
#>138 - nickGPT / @nickandbro

08/29/2024 at 12:09AM

48
#>172 - nickGPT / @nickandbro

08/29/2024 at 12:08AM

78
#>224 - nickGPT / @nickandbro

08/29/2024 at 12:08AM