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

548 active golfers, 2395 entries

Leaderboard (lowest score wins):
15
#181 - Baine Wedlock / @BaineWedlock

09/12/2019 at 11:38AM

15
#182 - Benoit Benoit / @Benoit_Tgt

09/12/2019 at 12:25PM

15
#183 - Abner jr / @Abnerjr19

09/21/2019 at 04:39PM

15
#184 - Miko / @_m_ik_o_

09/26/2019 at 04:23PM

15
#185 - Ivan Volosyuk / @IvanVolosyuk

10/21/2019 at 01:11PM

15
#186 - Volodymyr / @vkozach

12/01/2019 at 03:15PM

15
#187 - Michael Meixner / @meixner62

01/22/2020 at 06:12PM

15
#188 - Rune Warhuus / @DinkDonkNorway

01/23/2020 at 10:05AM

15
#189 - Jean-Francois Parent / @hacker_pyrat

02/07/2020 at 03:55PM

15
#190 - KingYames / @JamesZeHunter

02/25/2020 at 01:04PM

15
#191 - eshel / @EshelBM

02/28/2020 at 11:23AM

15
#192 - Paul Parker / @PaulDesmoParker

03/05/2020 at 01:00AM

15
#193 - floyd / @floyd10086

03/07/2020 at 07:05AM

15
#194 - Ryan Nevius / @ryannevius

03/18/2020 at 06:03AM

15
#195 - Jeff Cui / @jeffacce

05/13/2020 at 01:29AM

15
#196 - otfsenter / @otfsenter

06/03/2020 at 05:17PM

15
#197 - mocihan / @mocihan

07/03/2020 at 01:53PM

15
#198 - fenn.stefan@gmail.com / @FennStefan

08/26/2020 at 08:34PM

15
#199 - mindgitrwx / @mindgitrwx

09/03/2020 at 05:24AM

15
#200 - David Kutschke / @D4KU_

11/17/2020 at 08:33PM

15
#201 - roudens / @roudens2

12/09/2020 at 12:40AM

15
#202 - 영훈 / @odjfnrtm

01/06/2021 at 11:52PM

15
#203 - Ray Dennis / @raysden

01/08/2021 at 04:38PM

15
#204 - Anh Duc TRAN / @__OwlBlaster__

01/09/2021 at 04:44PM

16
#205 - Ítalo Vieira / @italoviieira

08/12/2018 at 01:04AM

16
#206 - Marco Magdy / @marcomacdee

08/12/2018 at 05:29PM

16
#207 - PCS Solutions / @PeteSolutions

08/13/2018 at 06:15AM

16
#208 - wes / @_weslly

08/14/2018 at 05:19AM

16
#209 - Valacar / @valacar

08/15/2018 at 03:28PM

16
#210 - Alexander Zheleznov / @ephemerr

08/16/2018 at 06:17AM