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):
20
#391 - mp / @mp28812322

07/17/2020 at 12:44PM

20
#392 - Brendan Schaenzer / @bschaenzer

09/30/2020 at 03:07PM

20
#393 - John Watson / @JRWats0n

11/07/2020 at 06:41AM

21
#394 - Chirag Joshi / @thechijos

08/12/2018 at 11:59PM

21
#395 - Frank Korf / @OMGFrank

08/14/2018 at 02:16PM

21
#396 - Fellow Millennium / @Fellow2000

09/03/2018 at 10:22AM

21
#397 - Alexander / @vlasyuk_a

09/04/2018 at 07:16PM

21
#398 - Daniel Morandini / @MorandiniDaniel

09/19/2018 at 08:55AM

21
#399 - Reuben Narkwo / @reubwo

10/21/2018 at 07:22PM

21
#400 - Sxcy / @SxcyX

10/24/2018 at 08:01AM

21
#401 - Calvin Fong / @LordyBaka

11/03/2018 at 11:05AM

21
#402 - Zenghanzhang / @hzengroger

11/10/2018 at 06:36AM

21
#403 - Jes / @vim_jes

12/05/2018 at 12:33PM

21
#404 - Vending Machine / @storyn26383

12/16/2018 at 07:05AM

21
#405 - Bennett / @bennettbackward

12/18/2018 at 02:25PM

21
#406 - omrisarig / @omrisarig

01/09/2019 at 06:46PM

21
#407 - Kevin Ullmann / @kevosauce

01/15/2019 at 12:12AM

21
#408 - vim_ninja / @NinjaVim

08/19/2019 at 04:10AM

21
#409 - averageRandomPerson / @averageRandomP1

09/16/2019 at 10:43PM

21
#410 - Juan Francisco Bertona / @Weed1an

10/15/2019 at 12:17PM

21
#411 - vicver09 / @vicver091

10/28/2019 at 06:40PM

21
#412 - Reynald Havard / @rey_ha

11/08/2019 at 11:26PM

21
#413 - None / @sh1chuang

01/09/2020 at 11:45AM

21
#414 - Emil / @emilklindt

02/16/2020 at 09:39PM

21
#415 - Put me on your list tyrants / @electronjunkie

08/20/2020 at 10:10PM

21
#416 - Arryue / @Arryue2

11/06/2020 at 08:48AM

21
#417 - John Doe / @JohnDoe75830353

12/24/2020 at 01:21AM

22
#418 - 安藤 / @andou2106

09/03/2018 at 03:12PM

22
#419 - Ketan Agrawal / @_ketan0_

09/24/2018 at 03:59PM

22
#420 - Edouard Piette / @EdPiette

10/09/2018 at 09:56AM