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

1517 active golfers, 4342 entries

Leaderboard (lowest score wins):
13
#991 - Andreas Hagesjö / @Ankhagge

05/07/2014 at 10:41PM

13
#992 - Jeff Parent / @jeffparent

05/11/2014 at 04:03PM

13
#993 - Augusto Pascutti / @augustohp

06/02/2014 at 09:45PM

13
#994 - Alec Johanson / @alecj007

06/16/2014 at 09:19PM

13
#995 - Chong Hong / @saberqsx

07/14/2014 at 10:14AM

13
#996 - Marco Biasini / @biasmv

07/17/2014 at 08:07PM

13
#997 - むつてる(あお) / @exumbra_insoIem

07/22/2014 at 01:24PM

13
#998 - Slartibartfast / @S_Bartfast

08/10/2014 at 08:13AM

13
#999 - Tj / @yrddy

08/13/2014 at 07:10AM

13
#1000 - Daniel / @dazn159

08/15/2014 at 10:18PM

13
#1001 - Martin Thoresen / @MartinHaTh

08/25/2014 at 11:21AM

13
#1002 - Ingolf / @bl4ckb1rd_LE

08/30/2014 at 07:27PM

13
#1003 - S̬̲͍̜̬t͈̟͈ev͉̳eB̝͓ / @SteveBarbera

09/01/2014 at 02:57AM

13
#1004 - Dario Avitabile / @tutticapaci

09/01/2014 at 01:34PM

13
#1005 - Noah Ruderman / @noahc66260

09/27/2014 at 10:24AM

13
#1006 - Philipp Aeschbach / @ihbmifqerg

10/12/2014 at 03:08PM

13
#1007 - Mauro Persano / @fzort

11/15/2014 at 06:30PM

13
#1008 - Glauco Pires / @grpires

11/25/2014 at 01:33PM

13
#1009 - Erik Buček / @_EnterNameHere_

11/26/2014 at 02:37PM

13
#1010 - luffy / @raxcoi

12/20/2014 at 12:42PM

13
#1011 - Jake Eskel / @JakeEskel

12/29/2014 at 12:14PM

13
#1012 - Andrea Mazzini / @theandreamazz

01/13/2015 at 01:09PM

13
#1013 - Thiago Prado / @5k1pp3r

03/02/2015 at 06:03PM

13
#1014 - TheProgrammer971 / @tp971

03/14/2015 at 11:22PM

13
#1015 - Jouko Karvonen / @joukokar

03/21/2015 at 02:27AM

13
#1016 - Tom van der Lee / @TomVdLee

04/22/2015 at 10:52AM

13
#1017 - Gracjan Grala / @gracjangrala

04/24/2015 at 11:07PM

13
#1018 - Rolf / @liffon

04/28/2015 at 07:48PM

13
#1019 - Elizabeth / @sprinkles418

05/11/2015 at 03:16PM

13
#1020 - David Stensland / @DavidStensland

05/19/2015 at 10:42PM