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):
15
#211 - 영훈 / @odjfnrtm

01/06/2021 at 11:52PM

15
#212 - Ray Dennis / @raysden

01/08/2021 at 04:38PM

15
#213 - Anh Duc TRAN / @__OwlBlaster__

01/09/2021 at 04:44PM

15
#214 - Michel Viktor / @tomkpz

08/08/2021 at 10:44PM

15
#215 - 7733865@qq.com / @tjxwg

10/05/2023 at 07:31AM

15
#216 - sosa-daniel / @sosa-daniel

12/29/2023 at 07:10PM

15
#217 - Pablo Acuna / @pacuna

11/04/2024 at 08:37PM

15
#218 - Nathan Priego / @nspriego

02/25/2025 at 02:46AM

15
#219 - 0xf00ff00f / @0xf00ff00f

01/19/2026 at 01:18AM

16
#220 - Ítalo Vieira / @italoviieira

08/12/2018 at 01:04AM

16
#221 - Marco Magdy / @marcomacdee

08/12/2018 at 05:29PM

16
#222 - PCS Solutions / @PeteSolutions

08/13/2018 at 06:15AM

16
#223 - wes / @_weslly

08/14/2018 at 05:19AM

16
#224 - Valacar / @valacar

08/15/2018 at 03:28PM

16
#225 - Alexander Zheleznov / @ephemerr

08/16/2018 at 06:17AM

16
#226 - we’re going to need a bigger bot / @assaflavie

08/16/2018 at 02:51PM

16
#227 - Cam Smith / @Comradesmith

08/21/2018 at 09:45AM

16
#228 - ♜ Pepe Doval / @pepellou

08/21/2018 at 10:58PM

16
#229 - zhenshan Xue / @xzs572

08/30/2018 at 02:17AM

16
#230 - Weston Neal / @wtneal

08/31/2018 at 03:56PM

16
#231 - Trey Deitch / @differenceeq

08/31/2018 at 08:13PM

16
#232 - tadashi-aikawa / @Tadashi_MAMAN

09/02/2018 at 06:57AM

16
#233 - Luis Copetti / @lhcopetti

09/05/2018 at 02:01AM

16
#234 - Rich Cheng / @sedm0784

09/10/2018 at 03:00PM

16
#235 - Michael K. Gilbert / @michaelKgilbert

09/16/2018 at 07:22AM

16
#236 - Stefan Heyder / @Astheny_

09/17/2018 at 09:27AM

16
#237 - Jonathan de Wet / @jonpdw

09/20/2018 at 03:15AM

16
#238 - Arijus / @argshook

09/21/2018 at 11:47AM

16
#239 - Vasil Mikhalenya / @bazillek

09/22/2018 at 07:12PM

16
#240 - DoubleIA / @IaDouble

09/30/2018 at 09:24AM