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

497 active golfers, 2156 entries

Leaderboard (lowest score wins):
17
#271 - Victor Chen / @VictorC89422342

01/10/2020 at 04:57PM

17
#272 - Robin Abrahamsson / @rqAbrahamsson

04/29/2020 at 03:27PM

17
#273 - dule2607 / @dule26071

04/30/2020 at 05:00PM

17
#274 - RockerZZY / @rocker_zzy

05/28/2020 at 09:59AM

18
#275 - Dr. Rev. J. "Paranoid Android" Kirchartz / @JKirchartz

08/19/2018 at 05:42PM

18
#276 - Daniel Vaqueiro / @chimidea

08/25/2018 at 10:25AM

18
#277 - CAO Tien Duc / @tienduccao

09/11/2018 at 08:53PM

18
#278 - Imre Kerr / @imre_kerr

09/13/2018 at 12:51PM

18
#279 - René Czerny / @ReneCzerny

09/16/2018 at 10:19AM

18
#280 - h3x3sworld / @h3x3sworld

09/17/2018 at 12:25PM

18
#281 - Drill / @DrillTroll

09/24/2018 at 10:20PM

18
#282 - vimgolf / @myspare307

09/25/2018 at 05:19AM

18
#283 - Keyboard Fire / @KeyboardFire

10/06/2018 at 09:28PM

18
#284 - c0llision / @sh3llcode

10/20/2018 at 07:04AM

18
#285 - m472 / @m4729

10/27/2018 at 06:45AM

18
#286 - vg / @vg53210350

10/29/2018 at 02:26AM

18
#287 - name / @name65894813

11/14/2018 at 04:36PM

18
#288 - Ohad Rubin / @OhadRubin

11/15/2018 at 03:44PM

18
#289 - Álvaro Melgosa / @AlvaroMlgs

11/17/2018 at 02:36PM

18
#290 - John Smith / @JohnSmi14480159

01/09/2019 at 11:04PM

18
#291 - Tim White / @antichrist65535

01/30/2019 at 04:19AM

18
#292 - Groovy / @groovy9

03/06/2019 at 10:25PM

18
#293 - Frede Emil / @Frede_Eb

05/05/2019 at 03:09PM

18
#294 - Nick Yeow / @nickyeow

05/21/2019 at 03:58PM

18
#295 - albert l wohletz / @l_wohletz

07/19/2019 at 10:20PM

18
#296 - Ivo Blöchliger / @aigledesalpes

08/02/2019 at 07:49PM

18
#297 - Clint Caudle / @ClintCaudle

08/21/2019 at 02:35PM

18
#298 - ciela / @lededex

08/28/2019 at 06:41PM

18
#299 - Lorenzo Bertolino / @lo_bertolino

10/09/2019 at 04:43PM

18
#300 - Michael / @michaelkwan1238

12/24/2019 at 07:09PM