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

1478 active golfers, 4243 entries

Leaderboard (lowest score wins):
19
#1411 - Shashank Srivastav / @fnatic_shank

02/01/2014 at 11:21AM

19
#1412 - Alex Bundy / @plntmusic

06/04/2014 at 03:41AM

19
#1413 - tapio / @gncnaxb

02/28/2018 at 08:12PM

20
#1414 - Alfredo Di Napoli / @alfredodinapoli

04/28/2012 at 05:03PM

20
#1415 - Alex Bartol / @alexbartol

05/06/2015 at 05:36AM

20
#1416 - Random Name / @spamplzignore

10/28/2017 at 08:11PM

20
#1417 - Thib / @thibthib_n

08/24/2018 at 05:32PM

20
#1418 - Jurica / @Jurica34581259

11/16/2018 at 11:15AM

21
#1419 - jared / @shmup

02/15/2012 at 07:02AM

21
#1420 - Dan Masquelier / @danmasq

02/16/2012 at 06:00PM

21
#1421 - Arto Vuori / @dhpe

08/31/2012 at 08:03PM

21
#1422 - Jesse Hixson / @jhixson

06/20/2014 at 08:58PM

21
#1423 - Bram Jans / @bramjns

04/08/2015 at 01:49PM

22
#1424 - bluse1995 / @bluse1995

01/21/2012 at 09:06PM

22
#1425 - Simon's Calf / @simonscarfe

03/08/2012 at 02:14PM

22
#1426 - ümit kablan / @udslk

03/09/2012 at 04:44PM

22
#1427 - Zachery Chin / @momochi0

11/05/2013 at 06:57PM

22
#1428 - Johan Berg / @_berg85

01/03/2014 at 11:39AM

22
#1429 - André Branco / @avbranco

06/29/2014 at 03:38PM

22
#1430 - Александърт / @a_lazaroff

01/15/2016 at 07:05PM

22
#1431 - Dennis Proksch / @DennisProksch

08/19/2018 at 04:41PM

23
#1432 - Eddie Monge / @eddiemonge

01/30/2012 at 07:13PM

23
#1433 - george  / @pa930

02/10/2012 at 10:23PM

23
#1434 - Igor / @trollmode

09/22/2015 at 09:00PM

23
#1435 - 杨洋 / @176795444

08/14/2017 at 12:02PM

23
#1436 - Omar Zeidan / @OZeidan97

11/14/2018 at 10:40AM

24
#1437 - Jakub Okoński / @farnoy

01/25/2012 at 02:39PM

24
#1438 - Steven Rosato / @steven_rosato

02/28/2012 at 08:17PM

24
#1439 - Jesse House / @house9twx

06/27/2013 at 12:42AM

24
#1440 - John Moon / @johnmoon6

11/18/2013 at 04:04AM