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


#580 nickGPT / @nickandbro - Score: 154 - 08/27/24 @ 05:09
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

580 active golfers, 2500 entries

Leaderboard (lowest score wins):
13
#1 - Demian Martinez / @demianuco

01/13/2025 at 12:05PM

14
#2 - BaffaloP πŸƒπŸŽ¨ / @bbaffalopp

11/18/2018 at 07:28PM

14
#3 - Dax / @zacoxi

11/20/2018 at 01:21AM

14
#4 - Joeoe / @joeoe_

11/24/2018 at 02:57PM

14
#5 - Jonathan Cabezas / @John_Harkan

11/26/2018 at 05:48PM

14
#6 - unclewangshushu / @shuwushu

11/29/2018 at 11:59AM

14
#7 - γ‚γ™γŸγ‘γ‚“ / @astatine0x55

12/01/2018 at 03:07PM

14
#8 - Artur MrΓ³z / @MrozArtur

12/05/2018 at 08:04PM

14
#9 - Anant Mishra / @anantanni22

12/08/2018 at 03:53PM

14
#10 - Quark / @PuzzleQuark

12/12/2018 at 12:42AM

14
#11 - Sebastien Nicoud / @sebnukem

12/24/2018 at 02:42AM

14
#12 - adir ohayon / @AdirKip

01/13/2019 at 10:54AM

14
#13 - heppen / @heppen_He

01/14/2019 at 06:54AM

14
#14 - Mario Olofo / @mario_olofo

01/19/2019 at 02:27AM

14
#15 - Marc PΓ€pper / @mpaepper

01/31/2019 at 04:20AM

14
#16 - πšƒπš’πšπš˜πšžπšŠπš— πšƒπšŽπš’πšœπšœπš’πšŽπš› / @TitouanT_

02/01/2019 at 04:36PM

14
#17 - xer0.5ive / @Bibekshah

02/02/2019 at 02:24PM

14
#18 - amal / @cdsudama

02/03/2019 at 09:41PM

14
#19 - Rasmus BergstrΓΆm / @JRasmusBm

02/07/2019 at 07:56AM

14
#20 - Filipe Brandenburger / @filbranden

02/17/2019 at 08:39AM

14
#21 - Turkey Man / @lvturkeyman

02/20/2019 at 06:09AM

14
#22 - sjcomp / @sjcomp

02/25/2019 at 05:06PM

14
#23 - Robert Orr / @orrrobert

03/11/2019 at 10:32PM

14
#24 - james_bunch / @james_bunch

03/12/2019 at 02:37AM

14
#25 - serent / @serent

03/12/2019 at 05:45AM

14
#26 - Parsa Amini / @ParsaAmini

03/19/2019 at 05:54PM

14
#27 - k24w24 / @k24w24

03/21/2019 at 04:26PM

14
#28 - Joel Eriksson / @OwariDa

04/05/2019 at 10:57AM

14
#29 - alekfed / @alek_fed

04/14/2019 at 07:23PM

14
#30 - Grant / @grant_7788

04/27/2019 at 11:30AM