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

1467 active golfers, 4212 entries

Leaderboard (lowest score wins):
28
#1441 - Elijah Lynn / @ElijahLynn

07/31/2014 at 02:22PM

28
#1442 - Matt Walsh / @wattmalsh

02/08/2017 at 06:33AM

29
#1443 - Mike Korcynski / @mkorcy

02/04/2012 at 06:55PM

30
#1444 - Rap Game Dan Aykroyd / @rapdanaykroyd

04/26/2012 at 09:24PM

30
#1445 - Zudov / @zudov_me

02/04/2014 at 08:03PM

31
#1446 - Artur Chruszcz / @a_chru

09/15/2013 at 01:22PM

31
#1447 - Matt Vague / @mattvague

11/30/2013 at 11:17PM

33
#1448 - jonathanpberger / @jonathanpberger

01/30/2012 at 02:58AM

33
#1449 - skellam / @skellam

02/19/2012 at 05:11PM

33
#1450 - Asenar / @asenar

06/02/2012 at 04:18PM

33
#1451 - James / @jamgood96

07/26/2013 at 10:07PM

34
#1452 - Lee Quarella / @leequarella

02/21/2012 at 01:18AM

37
#1453 - Matthias Viehweger / @der_kronn

01/27/2012 at 05:58PM

37
#1454 - BitLad / @BitLad

04/06/2018 at 11:00AM

38
#1455 - Alberto Sadde / @titicox

11/09/2013 at 10:59AM

41
#1456 - Егор / @DG3GfGxuYOQZgxN

10/24/2018 at 04:45AM

42
#1457 - Stephen Binns / @stephenbinns

09/08/2013 at 02:52PM

44
#1458 - Briana Baker / @brianacodes

12/21/2018 at 08:41PM

47
#1459 - Anton Yakimov / @kekc_tosha

11/21/2013 at 01:09PM

51
#1460 - nick / @nrehm

11/18/2013 at 12:42AM

51
#1461 - Pamela / @pamcdm

07/11/2014 at 02:21AM

52
#1462 - Noel Alejandro / @noelrock333

06/25/2012 at 08:35PM

55
#1463 - Kevin Lin / @kevinslin8

03/03/2012 at 11:38PM

69
#1464 - stb tra / @stbtra

01/28/2014 at 07:14PM

99
#1465 - SeanPlusPlus / @SeanPlusPlus

01/31/2012 at 06:33AM

103
#1466 - bradleydsmith / @bradleydsmith

10/20/2017 at 09:23PM

633
#1467 - Pete Pete / @iPetePete

02/14/2014 at 06:32PM