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 4fc9d767d3a0d4000100000e

Append semicolon after expressions

Some lines need the semicolon, some don't.

Start file
var foo

var bar = myCoolStuff()

callRemote()

foo = callTheWorld()
End file
var foo;

var bar = myCoolStuff();

callRemote();

foo = callTheWorld();

View Diff

1c1
< var foo
---
> var foo;
3c3
< var bar = myCoolStuff()
---
> var bar = myCoolStuff();
5c5
< callRemote()
---
> callRemote();
7c7
< foo = callTheWorld()
---
> foo = callTheWorld();

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 271 remaining solutions by signing in and submitting your own entry
#272 PLS / jaegd - Score: 13 - 08/30/14 @ 01:48
:g/a/s/$/;<CR>ZZ

0 comments


#273 Justin Knag / justinknag - Score: 13 - 09/07/14 @ 00:14
:%s/\S$/&;<CR>ZZ

0 comments


#274 Matthew Leadbetter / Halty - Score: 13 - 10/14/14 @ 16:38
qaA;<Esc>2jq3@aZZ

0 comments


#275 kungfuchad / kungfuchad - Score: 13 - 01/15/15 @ 12:46
qqA;<Esc>2jq3@qZZ

0 comments


#276 SilentFl / Silent_Fl - Score: 13 - 01/27/15 @ 14:33
qaA;<Esc>2jq3@aZZ

0 comments


#277 TheProgrammer971 / tp971 - Score: 13 - 03/14/15 @ 15:11
qaA;<Esc>jjq3@aZZ

0 comments


#278 William Ott / oddalot - Score: 13 - 04/09/15 @ 13:27
qqA;<Esc>jjq3@qZZ

0 comments


#279 Gael Roue / gaelroue - Score: 13 - 05/02/15 @ 15:46
:g/a/s/$/;<CR>ZZ

0 comments


#280 chvzvhn / chvzvhn - Score: 13 - 05/03/15 @ 20:43
qqA;<Esc>jjq3@qZZ

0 comments


#281 Hendrik Lammers / hendriklammers - Score: 13 - 05/28/15 @ 17:45
qqA;<Esc>jjq3@qZZ

0 comments


#282 Oliver Christ / 0liverChrist - Score: 13 - 08/25/15 @ 19:19
qqA;<Esc>jjq3@qZZ

0 comments


#283 Gerald Tilma / GeraldTilma - Score: 13 - 10/21/15 @ 01:12
qqA;<Esc>2jq5@qZZ

0 comments


#284 Zach Gulde / zgulde - Score: 13 - 02/29/16 @ 06:47
qqA;<Esc>jjq3@qZZ

0 comments


#285 Dimitar Dimitrov / kurkale6ka - Score: 13 - 03/18/16 @ 09:31
qqA;<Esc><CR><CR>q3@qZZ

0 comments


#286 iNaKoll / iNaKoll - Score: 13 - 05/08/16 @ 16:33
qqA;<Esc>2jq3@qZZ

0 comments


#287 Jake Worth / jwworth - Score: 13 - 08/24/16 @ 00:23
qqA;<Esc>jjq3@qZZ

0 comments


#288 jn / j1357924 - Score: 13 - 09/14/16 @ 19:24
qqA;<Esc>jjq3@qZZ

0 comments


#289 Kyouma / kyoumaJohn - Score: 13 - 10/14/16 @ 19:58
qqA;<Esc>2jq3@qZZ

0 comments


#290 Doug / AsnoGordo - Score: 13 - 07/04/17 @ 20:04
qqA;<Esc>2jq3@qZZ

0 comments


#291 Brandon Blakeley / zkelvin - Score: 13 - 11/25/17 @ 05:17
qqA;<Esc>2jq3@qZZ

0 comments


#292 celery rho gamma / rentalcustard - Score: 14 - 06/02/12 @ 09:35
A;<Esc>/^.<CR>.n.n.ZZ

0 comments


#293 Jakub Troszok / zosoooo - Score: 14 - 06/02/12 @ 10:05
:g/\S/s/$/;<CR>ZZ

0 comments


#294 Matty Williams / matty_jwilliams - Score: 14 - 06/08/12 @ 12:17
A;<Esc>2j.2j.2j.ZZ

0 comments


#295 Tadas Sce / tadassce - Score: 14 - 06/10/12 @ 20:41
A;<Esc>2j.2j.2j.ZZ

0 comments


#296 Carlos Hernando / chernando - Score: 14 - 06/13/12 @ 19:03
:g/\S/s/$/;<CR>ZZ

0 comments


#297 Florian Motlik / leanvienna - Score: 14 - 06/14/12 @ 12:47
:%s/.$/&;<CR>:wq<CR>

0 comments


#298 J Paul Daigle / philosodad - Score: 14 - 06/19/12 @ 13:17
qa$a;<Esc>jjq4@aZZ

0 comments


#299 Mike Kenyon / mike_kenyon - Score: 14 - 07/16/12 @ 17:10
A;<Esc>2j.2j.2j.ZZ

0 comments


#300 Lukas Korsika / LKorsika - Score: 14 - 07/17/12 @ 05:12
:%s/\S.*/&;<CR>ZZ

0 comments


#301 Kim Le / kimledev1 - Score: 14 - 07/31/12 @ 22:40
A;<Esc>2j.2j.2j.ZZ

0 comments


#302 Javier Cervantes / solojavier - Score: 14 - 09/04/12 @ 18:43
qq$a;<Esc>2jq3@qZZ

0 comments


#303 Adam Dratwinski / adwinsky - Score: 14 - 11/27/12 @ 19:33
A;<Esc>jj.jj.jj.ZZ

0 comments


#304 DJ LoBraico / pygatea - Score: 14 - 12/11/12 @ 23:20
qqA;<Esc>0jjq3@qZZ

0 comments


#305 Daniel Hahler / blueyed - Score: 14 - 01/22/13 @ 20:14
:%s/.$/\0;/<CR>ZZ

0 comments


#306 Derek Salerno / DerekSalerno - Score: 14 - 05/26/13 @ 22:24
A;<Esc>2j.2j.2j.ZZ

0 comments


#307 Dave Aitken / actionshrimp - Score: 14 - 08/27/13 @ 18:26
<CR>qgA;<Esc>jjq3@gZZ

0 comments


#308 Raphaël Saunier / RaphaelSaunier - Score: 14 - 08/27/13 @ 18:34
4@='A;<C-V><Esc>jj'<CR>ZZ

0 comments


#309 w1zeman1p / wizemanip - Score: 14 - 05/12/14 @ 18:58
A;<Esc>2j.2j.2j.ZZ

0 comments


#310 Patrick Pitoscia / Patrick03960431 - Score: 14 - 08/06/14 @ 02:35
A;<Esc>2j.2j.2j.ZZ

0 comments


#311 ltn614 / ltn614 - Score: 14 - 09/21/15 @ 06:08
qq$a;<Esc>2jq3@qZZ

0 comments


#312 Gurukandhamoorthi / Gurukandhamoor1 - Score: 14 - 07/13/17 @ 12:05
:v/^$/s/$/;<CR>ZZ

0 comments


#313 Mario Forner / m_forner - Score: 15 - 06/19/12 @ 07:13
qaA;<Esc>2jq3@a:wq<CR>

0 comments


#314 Kevin McGladdery / run_kmc - Score: 15 - 08/11/12 @ 23:58
A;<Esc>/)<CR>A;<Esc>n.n.ZZ

0 comments


#315 Tyler Breisacher / tbreisacher - Score: 15 - 08/25/12 @ 07:54
:%s/.$/\0;/g<CR>ZZ

0 comments


#316 wilddog64 / chengkai318 - Score: 15 - 12/17/13 @ 20:32
qqA;<Esc>jj0@qq@@ZZ

0 comments


#317 Etienne Tremel / etiennetremel - Score: 15 - 02/20/16 @ 21:04
:%s/.$/\0;/g<CR>ZZ

0 comments


#318 buz / buzbone - Score: 16 - 06/15/12 @ 01:48
:%s/^\w.*/\0;<CR>ZZ

0 comments


#319 Viswanath Sivakumar / viswanathgs - Score: 16 - 08/30/12 @ 15:24
:g/\S/s/$/;/g<CR>ZZ

0 comments


#320 murmurs / mrmrs_ - Score: 16 - 01/29/14 @ 00:34
:g/.$/norm A;<CR>ZZ

0 comments


#321 Alex Bundy / plntmusic - Score: 16 - 06/07/14 @ 20:55
qa$a;<Esc>jjq3@a:wq<CR>

0 comments


#322 LSMTD / LSMTD - Score: 16 - 12/09/14 @ 03:35
qa$a;<Esc>2jq3@a:wq<CR>

0 comments


#323 Jonathan / jmcphers - Score: 16 - 08/17/16 @ 23:53
:%s/.$/&;/g<CR>:wq<CR>

0 comments


#324 carbonscott / wangimagine - Score: 16 - 08/24/16 @ 00:31
:<C-P>g/\S/s/$/;<CR>:x<CR>

0 comments


#325 lauri lehmijoki / laurilehmijoki - Score: 17 - 06/02/12 @ 09:20
A;<Esc>:3<CR>.:5<CR>.:7<CR>.ZZ

laurilehmijoki: This solution does not scale – regex substitutions are much better!

1 comment


#326 Phil / ischi - Score: 17 - 01/02/13 @ 10:00
:g/^\S/norm A;<CR>ZZ

0 comments


#327 daveseibert / daveseibert - Score: 17 - 08/02/14 @ 04:14
:%s/\(.\)$/\0;<CR>ZZ

0 comments


#328 Endri Runa / endiruna - Score: 18 - 06/13/12 @ 00:41
A;<Esc>:3<CR>.jj;.jj.:wq<CR>

0 comments


#329 Christopher Biscardi / chrisbiscardi - Score: 18 - 07/17/12 @ 07:29
A;<Esc>:%s/)/);/g<CR>:wq<CR>

0 comments


#330 Hersh Singh / HershSingh - Score: 18 - 12/15/13 @ 18:51
:%s/\(\S\)$/\1;<CR>ZZ

0 comments


#331 Akshay Aurora / akshayaurora - Score: 18 - 09/16/14 @ 08:12
A;<Esc>:%s/)/);/g<CR>:wq<CR>

0 comments


#332 Stephan Baumeister / baumichel - Score: 19 - 07/12/12 @ 15:02
qq$a;<Esc>jjq@q@q@q:wq<CR>

0 comments


#333 Austin Ware / AustinWare17 - Score: 19 - 03/13/18 @ 02:22
A;E<BS><Esc>EA;<Esc>EA;<Esc>EA;<Esc>ZZ

0 comments


#334 Mark Burns / _mark_burns - Score: 20 - 06/02/12 @ 09:36
:%s/\v(.+)/\1;/g<CR>:x<CR>

0 comments


#335 Roel van Dijk / rdvdijk - Score: 22 - 06/05/12 @ 15:50
:%s/\([o)]\)$/\1;/<CR><Esc>ZZ

0 comments


#336 Marco / xmarkoz - Score: 22 - 06/28/12 @ 16:10
A;<Esc>2jA;<Esc>2jA;<Esc>2jA;<Esc>:wq<CR>

0 comments


#337 Calvin Flegal / calflegal - Score: 25 - 06/20/12 @ 23:22
A;<Esc>yljj$pjj$pjj$p:qw<BS><BS>wq<CR>

0 comments


#338 Jacob Vosmaer / jacobvosmaer - Score: 27 - 06/03/12 @ 11:32
:%norm <BS><BS><BS><BS><BS>s/$/;<CR>:%s/^;<CR>ZZ

0 comments


#339 Noel Alejandro / noelrock333 - Score: 38 - 06/23/12 @ 00:08
:4<BS>%s.<BS>/s<BS>)/x<BS>no<BS><BS>/<BS>(<BS>);/<CR>1G7la;<Esc>:w<CR><C-W>q

0 comments


Created by: laurilehmijoki

339 active golfers, 810 entries

Leaderboard (lowest score wins):
11
#1 - Urtica dioica / udioica

06/02/2012 at 06:17PM

11
#2 - Federico Galassi / federicogalassi

06/02/2012 at 08:44PM

11
#3 - Sergey / sav86

06/04/2012 at 12:13AM

11
#4 - Sebastian Kusnier / skusnier

06/04/2012 at 05:50PM

11
#5 - Tim Chase / gumnos

06/05/2012 at 01:53AM

11
#6 - Drew Hannay / drewhannay

06/09/2012 at 07:15AM

11
#7 - Jacek Wysocki / ex00

06/14/2012 at 10:11AM

11
#8 - Greg Sabo / gregsabo

06/21/2012 at 04:31AM

11
#9 - mwatkward / AftrschoolSpe

06/22/2012 at 11:53AM

11
#10 - Ryan O'Connell / Salshammath

06/23/2012 at 01:11PM

11
#11 - Brandon Montgomery / bmonty

06/23/2012 at 02:02PM

11
#12 - Vasil Sakarov / vsakarov

06/26/2012 at 09:50AM

11
#13 - John Dahlström / dahlstromjohn

06/27/2012 at 09:15PM

11
#14 - Raúl Jara / rauljara

07/06/2012 at 08:16PM

11
#15 - Wei Dai / clvv42

07/12/2012 at 08:42PM

11
#16 - John Piasetzki / jpiasetz

07/13/2012 at 06:21AM

11
#17 - shark dick / DickShark

07/13/2012 at 02:09PM

11
#18 - Sebastian Korten / FlashKorten

07/16/2012 at 11:21AM

11
#19 - wes / _weslly

07/16/2012 at 04:12PM

11
#20 - Benoit Thiell / benoitthiell

07/20/2012 at 01:38PM

11
#21 - mlu / _mlu

07/23/2012 at 01:03PM

11
#22 - Sean Griffin / sgrif

08/13/2012 at 02:49AM

11
#23 - retired account / retired10072015

08/21/2012 at 08:40AM

11
#24 - Petri Rosenström / wuzuuz

08/21/2012 at 05:48PM

11
#25 - Joseph J. Piché / jjpiche

09/02/2012 at 04:43PM

11
#26 - Joe Nelson / begriffs

09/03/2012 at 09:54PM

11
#27 - Conner McDaniel / connermcd

09/18/2012 at 04:34AM

11
#28 - Vim rocks / vimrocks

10/07/2012 at 01:36PM

11
#29 - Victor Ramirez / virako

10/13/2012 at 02:13AM

11
#30 - Saxon Unrue / joeunrue

11/09/2012 at 01:21PM