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):
14
#91 - speisz / @speiszc

07/24/2020 at 09:23PM

14
#92 - Ebi / @ehan6

08/01/2020 at 02:10PM

14
#93 - Theo Sarrazin / @tshaero

08/19/2020 at 09:20AM

14
#94 - Tanzeel Kazi / @tanzeelkazi

08/22/2020 at 10:06PM

14
#95 - Ivan Kwong / @IvanKwong5

10/02/2020 at 03:04PM

14
#96 - lamtt77 / @lamtt77

10/10/2020 at 02:48AM

14
#97 - vim-golf-requirement / @VRequirement

10/16/2020 at 03:50PM

14
#98 - Ifeoluwa Lawal / @IfeLawl

10/16/2020 at 03:52PM

14
#99 - Ravi S Sinha / @ambidextrousTx

10/19/2020 at 11:41PM

14
#100 - moh ayaya / @AyayaMoh

11/07/2020 at 07:16PM

14
#101 - hepebexè / @hepebexe

11/30/2020 at 07:06PM

14
#102 - Jung Yeon Park / @park_jungy

01/03/2021 at 08:48PM

14
#103 - A A A / @37fatos

01/09/2021 at 07:11PM

14
#104 - Andreas Siegrist / @andreaszwei

01/22/2021 at 01:33PM

14
#105 - Flimsy Giraffe / @flimsy_giraffe

11/28/2021 at 03:58PM

14
#106 - russellzhaomao / @russellzhaomao

05/27/2022 at 10:31AM

14
#107 - Janzen / @__Coos

10/03/2022 at 12:58PM

14
#108 - asirago / @asiragoo

12/13/2023 at 04:12AM

14
#109 - Peppa Pig / @PeppaPigSg

06/29/2024 at 05:34AM

14
#110 - Blake Raymond / @bit-ray

07/10/2024 at 04:24AM

14
#111 - Qingz / @Noct943

10/10/2024 at 07:01AM

14
#112 - UrbanNinja1010 / @UrbanNinja1010

04/07/2025 at 09:11AM

15
#113 - Jon Krause / @jkrause314

08/11/2018 at 05:14PM

15
#114 - Kerson Hsiao / @KersonHsiao

08/12/2018 at 12:47AM

15
#115 - “Smylers” / @Smylers2

08/12/2018 at 08:54PM

15
#116 - Charles Sun / @charles_sun90

08/13/2018 at 09:48PM

15
#117 - testingvimgolf / @testingvimgolf

08/14/2018 at 03:20AM

15
#118 - Keldwik Chaldain / @Suskeyhose

08/14/2018 at 07:59PM

15
#119 - 徐学健 / @zebrallel

08/15/2018 at 01:58AM

15
#120 - Søren Kjeil / @sfkjeil

08/15/2018 at 09:09AM