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

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 547 remaining solutions by signing in and submitting your own entry
#548 ser / @ser_robo - Score: 154 - 02/29/20 @ 08:36
jjr<Esc>wwciwcjhh<Esc>hhhhce42,<Esc>wcf"foobar<Esc>wwce''h<BS><Left>Another text<Esc>wwce<Esc>hxx<Esc>r<Esc>jjjjjj154<BS><BS>14Geeehce""<Left>Some amazing text<Esc>r<Esc>ewce123<Esc>wwce<Esc>c<Esc>llcf'variable<Esc>ba<Esc>i<BS><Esc>jjj<Esc>:wq<CR>

0 comments


Created by: @Tpouhuk2

548 active golfers, 2395 entries

Leaderboard (lowest score wins):
23
#451 - Hugo Tai / @HugoTai100

08/01/2019 at 09:16AM

23
#452 - Bob Ren / @bobrenjc93

08/05/2019 at 09:45PM

23
#453 - leo / @leo28356948

10/20/2019 at 04:48AM

23
#454 - Alex Emelianov / @AlexEmelianov3

11/04/2019 at 10:25PM

23
#455 - Chris Covert / @covertcj

11/08/2019 at 02:06AM

23
#456 - mowglian / @mowglian

01/18/2020 at 04:03PM

23
#457 - Hannes Käufler / @hanneskaeufler

07/05/2020 at 07:58PM

23
#458 - drGsus / @drGsus

07/25/2020 at 01:42PM

24
#459 - Vanildo S. Mangueira / @vanildo_souto

08/13/2018 at 01:57PM

24
#460 - editor3D / @editor3D

11/12/2018 at 06:45PM

24
#461 - xwlearn / @ixw1991

12/18/2018 at 04:32PM

24
#462 - Bao Dang / @baodang02

01/12/2019 at 06:48AM

24
#463 - Blah Blah / @BlahBla08410389

01/20/2019 at 06:44PM

24
#464 - Thomas Branch / @twighk

01/27/2019 at 01:44PM

24
#465 - py / @py97235249

01/31/2019 at 07:51AM

24
#466 - Michael Aquilina / @mikeaquilina4

02/02/2019 at 09:56PM

24
#467 - Emil Braserud / @Erdustiggen

03/16/2019 at 04:37PM

24
#468 - Vimfiz / @vimfiz

03/25/2019 at 11:05PM

24
#469 - JonasS / @jonas42s

05/29/2019 at 12:00PM

24
#470 - dtjong / @dtjong2

06/07/2019 at 10:10PM

24
#471 - Chadd Chambers / @dos_dees

07/03/2019 at 06:16AM

24
#472 - José / @AngelGaldamez

08/26/2019 at 03:57AM

24
#473 - Steve Racanovic / @steve_racanovic

01/13/2020 at 09:50PM

24
#474 - John Doe / @JohnDoe77150954

03/22/2020 at 06:21PM

24
#475 - Silvano Biemans / @smbiemans

07/25/2020 at 05:36PM

24
#476 - Kaustubh Murumkar / @k_austub_h

08/30/2020 at 01:57PM

25
#477 - Bernhard Brunner / @13brunner

08/29/2018 at 01:28PM

25
#478 - Matt Robinson / @mmrobins

09/14/2018 at 03:47PM

25
#479 - Ruben Paz / @IstarEldritch

09/15/2018 at 11:30PM

25
#480 - Paul Weaver / @UKWeaver

11/21/2018 at 07:33PM