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):
11
#421 - Yudi Matsuzake / @yudimatsuzake

06/07/2016 at 03:51PM

11
#422 - John Doe Sr. / @johndoe67890543

06/11/2016 at 01:25PM

11
#423 - T. Sakuma / @taku39

06/18/2016 at 01:32PM

11
#424 - TaoChen / @632143592Tao

06/20/2016 at 06:26AM

11
#425 - Noah Gumbert / @Noahrama

07/01/2016 at 04:55AM

11
#426 - William Snyders / @iam2391212

07/24/2016 at 06:32PM

11
#427 - Benjamin Espey / @bennyty

07/25/2016 at 03:53PM

11
#428 - Jeremiah Goyette / @JeremiahGoyette

08/01/2016 at 04:19AM

11
#429 - Ameen P / @Ameen_P1

08/07/2016 at 01:07AM

11
#430 - Abdullah / @dada3mn

08/11/2016 at 05:04AM

11
#431 - Erik Wenzel / @pl0pix

08/22/2016 at 07:49PM

11
#432 - win me / @win_me_

08/26/2016 at 06:12PM

11
#433 - jdupont655 / @jdupont655

09/02/2016 at 10:21AM

11
#434 - Stephen Aument / @saument

09/03/2016 at 04:42AM

11
#435 - Mateusz / @Mantos77

09/06/2016 at 09:47PM

11
#436 - hor1ace / @hor3ace

09/08/2016 at 02:52PM

11
#437 - 알카포 / @alkpo12

09/09/2016 at 07:18AM

11
#438 - loki2441 / @loki2441

09/10/2016 at 08:57PM

11
#439 - Michał Kordas / @michal_kordas

09/19/2016 at 08:01PM

11
#440 - Nico / @_Nico_Caro

09/30/2016 at 12:03AM

11
#441 - Netrisk Cool / @C00lt0

10/01/2016 at 09:50AM

11
#442 - David Fonseca / @ddfonseca6

10/08/2016 at 02:01PM

11
#443 - jinx balotchnik / @balotchnik

10/14/2016 at 02:39AM

11
#444 - Bill Ruddock / @biinari

10/31/2016 at 03:40AM

11
#445 - retro / @tryphopp

11/01/2016 at 01:29AM

11
#446 - Jonathan Elliott / @jon__elliott

11/02/2016 at 10:54PM

11
#447 - Jon Louie / @jjisnow

11/24/2016 at 01:49AM

11
#448 - Wessel Sinnema / @wsinnema

11/27/2016 at 05:31PM

11
#449 - Alan Turing / @alantrng

11/28/2016 at 10:22PM

11
#450 - Liam S Ismail / @AC01Y

12/07/2016 at 03:56AM