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

519 active golfers, 2257 entries

Leaderboard (lowest score wins):
18
#301 - Tim White / @antichrist65535

01/30/2019 at 04:19AM

18
#302 - Groovy / @groovy9

03/06/2019 at 10:25PM

18
#303 - Frede Emil / @Frede_Eb

05/05/2019 at 03:09PM

18
#304 - Nick Yeow / @nickyeow

05/21/2019 at 03:58PM

18
#305 - albert l wohletz / @l_wohletz

07/19/2019 at 10:20PM

18
#306 - Ivo Blöchliger / @aigledesalpes

08/02/2019 at 07:49PM

18
#307 - Clint Caudle / @ClintCaudle

08/21/2019 at 02:35PM

18
#308 - ciela / @lededex

08/28/2019 at 06:41PM

18
#309 - Lorenzo Bertolino / @lo_bertolino

10/09/2019 at 04:43PM

18
#310 - Michael / @michaelkwan1238

12/24/2019 at 07:09PM

18
#311 - Steffen / @Pions90

02/27/2020 at 06:53PM

18
#312 - volandkit / @volandkit

04/20/2020 at 09:35PM

18
#313 - jackmark / @jackmar14540583

07/11/2020 at 08:19AM

18
#314 - yuval jacoby / @yuval_jacoby

07/11/2020 at 09:43PM

18
#315 - Martin Kauppinen / @MartinKauppinen

08/15/2020 at 07:19PM

19
#316 - ؜ / @h43z

08/11/2018 at 11:23PM

19
#317 - yqu212 / @yqu212

08/12/2018 at 01:47AM

19
#318 - Parrot Tech / @parrot_tech

08/13/2018 at 07:46AM

19
#319 - Shutterspot Photo / @shutterspot

08/13/2018 at 04:06PM

19
#320 - daniel / @daniel31464605

08/17/2018 at 07:34PM

19
#321 - Cathal McGuire / @cmcguire79

08/24/2018 at 04:00PM

19
#322 - Ryan Daniels / @RyanNeilDaniels

08/28/2018 at 08:55AM

19
#323 - Louis Palma / @Lou_C137

08/28/2018 at 07:53PM

19
#324 - Jan Wedekind / @wedesoft

09/01/2018 at 09:10PM

19
#325 - Kristian Lumme / @kristianlumme

09/04/2018 at 10:15AM

19
#326 - Matt Tony / @Dark_Rider85

09/05/2018 at 08:38PM

19
#327 - Toby Runo / @toptab267

09/15/2018 at 01:26PM

19
#328 - davidkaskwith / @davidkaskwith

10/03/2018 at 12:59AM

19
#329 - Anthony George / @Xanuthatusu

10/29/2018 at 09:51PM

19
#330 - aka / @aaik4

12/23/2018 at 03:03AM