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):
11
#451 - J. Cosa / @esoesotracosa

01/18/2017 at 10:23AM

11
#452 - Ymte Jan Broekhuizen / @ymtejan

02/02/2017 at 12:24AM

11
#453 - Zhihong Liu / @pieapple03

02/06/2017 at 02:43PM

11
#454 - Vimgolf / @vimgolf987

02/26/2017 at 08:05PM

11
#455 - Jim Bob / @babyclubber

02/28/2017 at 01:02AM

11
#456 - Brian Hall / @_bruab_

03/02/2017 at 02:42PM

11
#457 - Peter Sand / @PeterSand12

03/11/2017 at 03:27AM

11
#458 - Alexander Bessonov / @nonsleepr

03/14/2017 at 10:20PM

11
#459 - Ilya Shakirov / @aelaau

03/20/2017 at 02:28PM

11
#460 - Andreas Anderbach / @anderbacha

03/21/2017 at 11:57AM

11
#461 - Zachary Neubert / @Mr_Saturn16347

03/24/2017 at 01:03AM

11
#462 - Edras / @Edras41862627

03/28/2017 at 10:07AM

11
#463 - Solomon / @Trugbildjaeger

04/01/2017 at 08:22AM

11
#464 - 梧桐王子 / @WutongYujie

04/25/2017 at 04:58AM

11
#465 - Tom BP / @ThosBP

04/25/2017 at 09:03AM

11
#466 - Remus Dalrymple / @bornintheflames

05/06/2017 at 11:49PM

11
#467 - Chris Robertson / @chrisxrobertson

05/07/2017 at 05:49AM

11
#468 - Anders Schramm / @AndersSchramm

05/23/2017 at 11:28AM

11
#469 - Will Wright 👨🏻‍💻 / @WilliamWright

05/25/2017 at 03:29PM

11
#470 - Melvin Cheung / @MelvinCheung

05/25/2017 at 05:31PM

11
#471 - Florian Gauger / @FlorianGauger

06/03/2017 at 12:59AM

11
#472 - David Gustavsson / @mrGustaphe

06/10/2017 at 08:06PM

11
#473 - John Smith / @johns32768

06/17/2017 at 11:44AM

11
#474 - Bennett Bernardoni / @BBernardoni

06/28/2017 at 08:58PM

11
#475 - Avian Y / @y_avian

06/29/2017 at 06:26AM

11
#476 - Fred Sladkey / @fsladkey

07/04/2017 at 06:23PM

11
#477 - Fatalis / @fatalis_

07/09/2017 at 02:03AM

11
#478 - Михаил Добров / @mSuGfwFz2ZNvv5b

07/10/2017 at 08:52PM

11
#479 - huho / @huho_xu

08/09/2017 at 08:27PM

11
#480 - Daniel / @0x9ABC

08/18/2017 at 06:42PM