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

1553 active golfers, 4453 entries

Leaderboard (lowest score wins):
17
#1441 - makuchy / @makuchy

02/01/2014 at 12:38PM

17
#1442 - Felipe / @FelipeSah

02/23/2014 at 02:37PM

17
#1443 - Ri / @riateche

03/02/2014 at 02:22PM

17
#1444 - Solar Powered Robot / @moskrin

04/30/2014 at 06:19PM

17
#1445 - aaron whitehead / @bigmacstorm

08/29/2014 at 06:22AM

17
#1446 - Dr4k3 / @Dr4k3_LE

08/31/2014 at 10:51AM

17
#1447 - Francescu Santoni / @Francescu

12/15/2014 at 10:19AM

17
#1448 - Jordana Lachow / @TomofBedlam

01/09/2015 at 03:15PM

17
#1449 - ɐʇnɥsɐpoʇ / @todashuta

03/25/2015 at 01:48PM

17
#1450 - Gabriel Magno / @GabrielMagno

06/05/2015 at 10:27PM

17
#1451 - Izabel Jelenić / @IzabelJelenic

12/25/2015 at 10:52PM

17
#1452 - Hank Chinaski / @uktechman

04/25/2016 at 04:58PM

17
#1453 - 伺か / @ojiry

07/17/2018 at 09:56AM

17
#1454 - Bernhard Brunner / @13brunner

08/28/2018 at 07:16AM

17
#1455 - Sxcy / @SxcyX

10/22/2018 at 02:12PM

17
#1456 - Roger Leitner / @roger_leitner

10/20/2019 at 02:47PM

18
#1457 - Raja Sharan Mamidala / @rajasharan

01/30/2012 at 07:46PM

18
#1458 - Tyler Breisacher / @tbreisacher

08/28/2012 at 06:25AM

18
#1459 - venkatakrishnan / @venkatk_

08/19/2013 at 03:48PM

18
#1460 - Matty Williams / @matty_jwilliams

08/27/2013 at 10:12AM

18
#1461 - Christian Genco / @cgenco

02/12/2014 at 03:41AM

18
#1462 - Josh Szepietowski / @joshSzep

11/04/2014 at 11:24PM

18
#1463 - Andrew Michaud / @andrewjmichaud

09/04/2015 at 01:14AM

18
#1464 - Theodore DeRego / @tedsta0

12/08/2015 at 03:12AM

18
#1465 - Scott Traver / @ScottTraver

02/12/2016 at 10:42PM

18
#1466 - Jared Fowler / @jared_fowler

07/29/2017 at 01:10AM

18
#1467 - artisan bed maker / @ebencooke

01/15/2018 at 03:13PM

18
#1468 - Daniel de Vries / @devries_d

02/13/2018 at 12:52AM

18
#1469 - Akilan Anbalagan / @akilananb

03/27/2018 at 01:06PM

18
#1470 - egormeister / @egormeister1

10/24/2018 at 03:15PM