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

1749 active golfers, 5079 entries

Leaderboard (lowest score wins):
11
#211 - Nathan Wallace / @nathanmwallace

11/05/2013 at 03:05PM

11
#212 - Charles H. Leggett / @cleggett

11/06/2013 at 12:02AM

11
#213 - Christian C. Salvadó / @cmsalvado

11/14/2013 at 06:35AM

11
#214 - Edgar Hipp / @EdgarHipp

11/14/2013 at 08:28PM

11
#215 - Rob Findley / @Rob_Findley

11/25/2013 at 05:21AM

11
#216 - Daniel Marjenburgh / @dmarjenburgh

11/25/2013 at 02:41PM

11
#217 - John Braxler / @braxler

11/26/2013 at 10:20PM

11
#218 - Brett Cassette / @brettcassette

11/30/2013 at 07:54AM

11
#219 - Stefan Schmidt / @stafue

12/05/2013 at 03:16PM

11
#220 - R. Alex / @Ralex1098

12/08/2013 at 08:25PM

11
#221 - D / @justcallmedrago

12/15/2013 at 06:36AM

11
#222 - RobertT / @techrt2050

12/15/2013 at 06:58AM

11
#223 - Joseph Ku / @josephku

12/17/2013 at 04:11PM

11
#224 - Andrew O'Neill / @AndroidOatmeal

12/18/2013 at 02:11PM

11
#225 - Joshua Appelman / @JoshuaAppelman

12/20/2013 at 09:29PM

11
#226 - Paul Liu / @automorphism

12/21/2013 at 03:25PM

11
#227 - winterlight / @winterlight4

12/24/2013 at 02:34PM

11
#228 - chilicuil / @chilicuil

12/27/2013 at 11:08AM

11
#229 - Rado Kirov / @radokirov

12/29/2013 at 06:47AM

11
#230 - Fake Name / @The_Real_User

01/08/2014 at 01:00AM

11
#231 - Viacheslav / @nordsp

01/09/2014 at 01:54PM

11
#232 - oliver mueller / @marcontwit

01/09/2014 at 09:22PM

11
#233 - John / @BerlinSchneider

01/15/2014 at 08:16AM

11
#234 - alexscott / @4l3xsc0tt

01/15/2014 at 04:04PM

11
#235 - adi li / @guessimtoolate

01/19/2014 at 06:56PM

11
#236 - Christian Welle / @welle_tw

01/20/2014 at 09:43PM

11
#237 - John Amicangelo / @AmicangeloJohn

01/21/2014 at 07:54PM

11
#238 - Rainer Koirikivi / @rkoiriki

01/23/2014 at 11:10AM

11
#239 - Rasmus P / @rasmup

01/24/2014 at 11:52PM

11
#240 - vtavares00dev / @vtavares00dev

01/26/2014 at 04:39AM