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):
17
#271 - Caleb Rollins / @CalebRollins1

05/28/2019 at 05:49PM

17
#272 - Scott Schlesier / @sschlesier

06/29/2019 at 06:44AM

17
#273 - Mr_Djez / @DjezMr

08/06/2019 at 05:45AM

17
#274 - りんご / @ringo9971

08/10/2019 at 04:01AM

17
#275 - Vim Player / @PlayerVim

09/13/2019 at 11:53AM

17
#276 - Ariel Miculas / @ArielMiculas

09/19/2019 at 09:16AM

17
#277 - Andrei Popescu / @AndreiTheory

12/09/2019 at 05:44PM

17
#278 - Jason Neylon / @jasonneylon

12/26/2019 at 11:34AM

17
#279 - Wenbo / @nuxping1

12/28/2019 at 07:36PM

17
#280 - Victor Chen / @VictorC89422342

01/10/2020 at 04:57PM

17
#281 - Robin Abrahamsson / @rqAbrahamsson

04/29/2020 at 03:27PM

17
#282 - dule2607 / @dule26071

04/30/2020 at 05:00PM

17
#283 - RockerZZY / @rocker_zzy

05/28/2020 at 09:59AM

17
#284 - akouryy / @akouryy1

09/15/2020 at 11:59AM

18
#285 - Dr Rev J. “I am not a bot!” Kirchartz, KSC, KHS / @JKirchartz

08/19/2018 at 05:42PM

18
#286 - Daniel Vaqueiro / @chimidea

08/25/2018 at 10:25AM

18
#287 - CAO Tien Duc / @tienduccao

09/11/2018 at 08:53PM

18
#288 - Imre Kerr / @imre_kerr

09/13/2018 at 12:51PM

18
#289 - René Czerny / @ReneCzerny

09/16/2018 at 10:19AM

18
#290 - h3x3sworld / @h3x3sworld

09/17/2018 at 12:25PM

18
#291 - Drill / @DrillTroll

09/24/2018 at 10:20PM

18
#292 - vimgolf / @myspare307

09/25/2018 at 05:19AM

18
#293 - Keyboard Fire / @KeyboardFire

10/06/2018 at 09:28PM

18
#294 - c0llision / @sh3llcode

10/20/2018 at 07:04AM

18
#295 - m472 / @m4729

10/27/2018 at 06:45AM

18
#296 - vg / @vg53210350

10/29/2018 at 02:26AM

18
#297 - name / @name65894813

11/14/2018 at 04:36PM

18
#298 - Ohad Rubin / @OhadRubin

11/15/2018 at 03:44PM

18
#299 - Álvaro Melgosa / @AlvaroMlgs

11/17/2018 at 02:36PM

18
#300 - John Smith / @JohnSmi14480159

01/09/2019 at 11:04PM