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 5b6f0fcba89379000c2328a4

Swap values inside brackets

Easy challenge.

Start file
#Everyday routine... :\ 

amazing_func
("Some amazing text", 123, variable) # Kittens

def func():
       
return 'Stuff for making movement harder'

def func2(m):
        v
= 0
       
for i in range(10):
                v
+= i*m
               
print(v, i, m)

very_strange_func
(42, foobar, 'Another text') # Dogs

test
= func()
func2
(len(test))
End file
#Everyday routine... :\ 

amazing_func
(42, foobar, 'Another text') # Kittens

def func():
       
return 'Stuff for making movement harder'

def func2(m):
        v
= 0
       
for i in range(10):
                v
+= i*m
               
print(v, i, m)

very_strange_func
("Some amazing text", 123, variable) # Dogs

test
= func()
func2
(len(test))

View Diff

3c3
< amazing_func("Some amazing text", 123, variable) # Kittens
---
> amazing_func(42, foobar, 'Another text') # Kittens
14c14
< very_strange_func(42, foobar, 'Another text') # Dogs
---
> very_strange_func("Some amazing text", 123, variable) # Dogs

Solutions by @EshelBM:

Unlock 7 remaining solutions by signing in and submitting your own entry
Created by: @Tpouhuk2

580 active golfers, 2500 entries

Solutions by @EshelBM:
15
#199 - eshel / @EshelBM

02/28/2020 at 11:23AM

15
#>199 - eshel / @EshelBM

02/28/2020 at 11:25AM

16
#>266 - eshel / @EshelBM

02/28/2020 at 11:22AM

17
#>310 - eshel / @EshelBM

02/28/2020 at 11:19AM

18
#>346 - eshel / @EshelBM

02/28/2020 at 11:21AM

19
#>382 - eshel / @EshelBM

02/28/2020 at 11:11AM

43
#>567 - eshel / @EshelBM

02/28/2020 at 11:28AM