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 474 remaining solutions by signing in and submitting your own entry
#475 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

475 active golfers, 2044 entries

Leaderboard (lowest score wins):
34
#451 - vimgolfer1234 / @vimgolfer12342

10/25/2018 at 12:20AM

34
#452 - Hao-Ting Wang / @HaoTingW713

06/20/2019 at 02:23PM

35
#453 - pankaj singh / @pankajsingh013

01/14/2019 at 04:02PM

35
#454 - Vim Golfer / @VimGolfer6

07/08/2019 at 01:10PM

36
#455 - Praful / @praful_kapadia

08/15/2018 at 01:47PM

36
#456 - LadyScream / @TheLadyScream

08/27/2018 at 03:55AM

36
#457 - FP / @FPjde

09/16/2018 at 04:17PM

36
#458 - Martin Nordgren / @MartinJNordgren

09/21/2018 at 09:12AM

37
#459 - Christopher / @Rephiscorth

08/24/2018 at 10:01PM

38
#460 - The Joe / @computerjoe708

03/17/2019 at 04:46PM

41
#461 - kevin / @kevin_sdc

09/02/2018 at 02:23AM

41
#462 - Patryk Jachowski / @y4ch_

11/10/2018 at 04:19PM

43
#463 - Toby R / @TobyRet

11/01/2018 at 09:11AM

43
#464 - Jake Nixon / @thejakenixon

09/29/2019 at 10:24PM

45
#465 - Eric Moss / @NotEricMoss

11/06/2018 at 02:57AM

50
#466 - faraaz / @mfyk84

08/19/2018 at 08:55PM

50
#467 - Alvaro Melendez / @alvaromelendezh

02/21/2020 at 06:23PM

53
#468 - Briana Baker / @brianacodes

12/21/2018 at 05:52PM

65
#469 - Ahmed Zakir / @ahmadmzak

01/26/2020 at 01:38AM

86
#470 - maxime he / @he_maxime

08/12/2018 at 07:05PM

88
#471 - lf123 / @qwwsaa123

09/12/2018 at 01:20PM

94
#472 - . / @jfkdk91

09/12/2018 at 10:57PM

99
#473 - edward testing / @testingedward

03/04/2020 at 07:05PM

151
#474 - tuyen / @tuyen66827418

11/19/2018 at 02:57PM

154
#475 - ser / @ser_robo

02/29/2020 at 08:36AM