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

switch variable

how fast can you switch two variable ?

Start file
int barins, foovariable = 1; 
End file
int foovariable, barins = 1; 

View Diff

1c1
< int barins, foovariable = 1; 
---
> int foovariable, barins = 1; 

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 1508 remaining solutions by signing in and submitting your own entry
#1509 Pete Pete / @iPetePete - Score: 633 - 02/14/14 @ 18:32
:s/int (.<BS>a<BS>[a-z]+),<Left><Left><Left><Left><Left><Left><Left><Left><Left><Right><Right><Right><Right><Right><Right><Right><Right><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS>(int )([^,]+)<Right> (/w<BS><BS>w<BS>\w)(.*)/$1$3, $<BS>$2$5<BS>4/<CR>i:<BS><Esc>:s/int (\w)/hi/g<CR>:s.<BS>/iu<BS>nt (\w+), (w<BS>\w+)/int $2, $1/<CR>:s/int ([a-z]+), ([a_<BS>-z])<BS>+)/int $2, #<BS>$1/<CR>:s/int/<BS> ([a-z]+)<CR><Up>:<Up>/ int<BS><BS><BS><BS>int fuck/<CR>:s/int <BS>\ barin<BS><BS><BS><BS><BS>barin<BS><BS><BS><BS><BS>([a-z]+)/<BS>, <BS>\ ([a-z]+)/int $2<BS><BS><BS>\ 2<BS>$2, $2<BS><BS><BS><BS>m<BS>,\ $1/g<CR>/s<BS><BS>:#<BS>%s/barins/foovariable/g<CR>:q<BS>%/s<BS><BS>s/([a-z]+)<BS><Left><Left><Left><Left><Left><Left><BS><Right><Right><Right><Right><Right><Right>/dude/g<CR>::<BS>u<CR>:s/int \(a<BS>[a-z]+)<BS>\), \([a-z]+\(<BS>)/int $2, $1/<CR>:<Up><C-A>%<BS><BS><Left><Left><Left><Left><Left><Left>^<Left><Right><BS><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left>%<CR>:<Up><Down>%s/int (<BS>\9a<BS><BS>([a-z]_<BS><BS>]\<BS>\+\)/int $1-fart/<CR>u<Up>:<Up><Left><Right><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS>, \(<BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS>barins)<BS>\), (<BS>\(fa<BS>oovariable\)/int \2, $<BS>\1<CR>:wq<CR>

0 comments


Created by: @lukastsai

1509 active golfers, 4317 entries

Leaderboard (lowest score wins):
24
#1471 - John Moon / @johnmoon6

11/18/2013 at 04:04AM

24
#1472 - Prasanna N / @SupertrampPras

09/19/2014 at 10:21AM

25
#1473 - Timothy Hahn / @timyhahn

04/20/2012 at 03:59AM

25
#1474 - Mark Zalar / @ZalarMark

04/24/2012 at 10:52AM

25
#1475 - Pablo / @chambawamba358

10/02/2013 at 01:52PM

25
#1476 - pawelmhm / @pawelmhm

03/01/2014 at 07:49PM

25
#1477 - Charles Neill / @ccneill

05/01/2014 at 01:30AM

25
#1478 - hashcookyz / @hashcookyz

08/23/2018 at 03:00PM

28
#1479 - John Hilliard / @praetorian

04/12/2012 at 08:47PM

28
#1480 - Peter Lustig / @LustigPeter42

07/29/2013 at 09:52PM

28
#1481 - Geoffrey Giesemann / @ggiesemann

08/16/2013 at 11:57AM

28
#1482 - Kevin James / @KevinKarruthers

11/20/2013 at 08:43PM

28
#1483 - Elijah Lynn / @ElijahLynn

07/31/2014 at 02:22PM

28
#1484 - Matt Walsh / @wattmalsh

02/08/2017 at 06:33AM

29
#1485 - Mike Korcynski / @mkorcy

02/04/2012 at 06:55PM

30
#1486 - Rap Game Dan Aykroyd / @rapdanaykroyd

04/26/2012 at 09:24PM

30
#1487 - Zudov / @zudov_me

02/04/2014 at 08:03PM

31
#1488 - Artur Chruszcz / @a_chru

09/15/2013 at 01:22PM

31
#1489 - Matt Vague / @mattvague

11/30/2013 at 11:17PM

33
#1490 - jonathanpberger / @jonathanpberger

01/30/2012 at 02:58AM

33
#1491 - skellam / @skellam

02/19/2012 at 05:11PM

33
#1492 - Asenar / @asenar

06/02/2012 at 04:18PM

33
#1493 - James / @jamgood96

07/26/2013 at 10:07PM

34
#1494 - Lee Quarella / @leequarella

02/21/2012 at 01:18AM

37
#1495 - Matthias Viehweger / @der_kronn

01/27/2012 at 05:58PM

37
#1496 - BitLad / @BitLad

04/06/2018 at 11:00AM

38
#1497 - Alberto Sadde / @titicox

11/09/2013 at 10:59AM

41
#1498 - Егор / @DG3GfGxuYOQZgxN

10/24/2018 at 04:45AM

42
#1499 - Stephen Binns / @stephenbinns

09/08/2013 at 02:52PM

44
#1500 - Briana Baker / @brianacodes

12/21/2018 at 08:41PM