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


#589 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

589 active golfers, 2526 entries

Leaderboard (lowest score wins):
18
#331 - vimgolf / @myspare307

09/25/2018 at 05:19AM

18
#332 - Andy Tockman / @atckmn

10/06/2018 at 09:28PM

18
#333 - c0llision / @sh3llcode

10/20/2018 at 07:04AM

18
#334 - m472 / @m4729

10/27/2018 at 06:45AM

18
#335 - vg / @vg53210350

10/29/2018 at 02:26AM

18
#336 - name / @name65894813

11/14/2018 at 04:36PM

18
#337 - Ohad Rubin / @OhadRubin

11/15/2018 at 03:44PM

18
#338 - Álvaro Melgosa / @AlvaroMlgs

11/17/2018 at 02:36PM

18
#339 - John Smith / @JohnSmi14480159

01/09/2019 at 11:04PM

18
#340 - Tim White / @antichrist65535

01/30/2019 at 04:19AM

18
#341 - Groovy / @groovy9

03/06/2019 at 10:25PM

18
#342 - Frede Emil / @Frede_Eb

05/05/2019 at 03:09PM

18
#343 - Nick Yeow / @nickyeow

05/21/2019 at 03:58PM

18
#344 - albert l wohletz / @l_wohletz

07/19/2019 at 10:20PM

18
#345 - Ivo Blöchliger / @aigledesalpes

08/02/2019 at 07:49PM

18
#346 - Clint Caudle / @ClintCaudle

08/21/2019 at 02:35PM

18
#347 - ゆに / @lededex

08/28/2019 at 06:41PM

18
#348 - Lorenzo Bertolino / @lo_bertolino

10/09/2019 at 04:43PM

18
#349 - Michael / @michaelkwan1238

12/24/2019 at 07:09PM

18
#350 - Steffen / @Pions90

02/27/2020 at 06:53PM

18
#351 - volandkit / @volandkit

04/20/2020 at 09:35PM

18
#352 - jackmark / @jackmar14540583

07/11/2020 at 08:19AM

18
#353 - yuval jacoby / @yuval_jacoby

07/11/2020 at 09:43PM

18
#354 - Martin Kauppinen / @MartinKauppinen

08/15/2020 at 07:19PM

18
#355 - Sven H. / @mostley

10/30/2020 at 06:22PM

18
#356 - Nedko Nedkov / @NedkoNedkov6

12/27/2020 at 10:06PM

18
#357 - wex / @wex12923175

04/02/2021 at 07:00AM

18
#358 - Jean George / @JeanGeo20504212

09/08/2021 at 08:48PM

18
#359 - Erisian Aspect / @ErisianAspect

05/25/2022 at 07:12PM

18
#360 - Alex / @AlexanderHeatl2

07/06/2022 at 11:50PM