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
#301 - Jonas Arnold Clasen / @jonasclasen

06/09/2014 at 06:01PM

11
#302 - Robert Bruce / @therealrobru

06/10/2014 at 11:40PM

11
#303 - John Meisner / @jmeisned

06/24/2014 at 08:16PM

11
#304 - Tim Vim / @vim_tim

07/02/2014 at 04:55PM

11
#305 - Empress Effects / @empress_effects

07/03/2014 at 11:41PM

11
#306 - kwa / @kwa129

07/06/2014 at 01:22PM

11
#307 - Lasse Dalegaard / @ldalegaard

07/07/2014 at 08:34PM

11
#308 - playalong / @playwithit42

07/08/2014 at 11:26AM

11
#309 - Alexey Fedorov / @waterlink000

07/08/2014 at 05:41PM

11
#310 - magizbox / @rain_1024

07/13/2014 at 04:14AM

11
#311 - Caek / @Caek_

07/14/2014 at 03:11AM

11
#312 - Oleg Tsymbalyuk / @oleg_tc

07/15/2014 at 04:58AM

11
#313 - Haoxuan Yue / @yuehaoxuanar

07/16/2014 at 04:14PM

11
#314 - RiccardoSven Risuleo / @riccardosven

07/18/2014 at 05:32PM

11
#315 - Tom Layte / @tlayte

07/19/2014 at 12:39AM

11
#316 - Rafee / @rafee_buet

07/20/2014 at 09:50AM

11
#317 - Dominik Szerszeń / @DominikSze

07/22/2014 at 10:29AM

11
#318 - Yoonho Lee / @ID_einet89

07/25/2014 at 09:05AM

11
#319 - PLS / @jaegd

08/03/2014 at 02:30AM

11
#320 - fa / @twiteciop

08/06/2014 at 07:57PM

11
#321 - Phil Dubach / @fuiru

08/14/2014 at 04:01AM

11
#322 - Bill Booth / @ohiopyle

08/20/2014 at 06:07AM

11
#323 - Harald H / @metellius

08/20/2014 at 10:04AM

11
#324 - Zapata / @Incredible_JFP

08/21/2014 at 08:20PM

11
#325 - Alexey Permyakov / @AlexeyPermyakov

08/24/2014 at 10:27AM

11
#326 - brandon salmon / @Exiledz

08/29/2014 at 06:37AM

11
#327 - Aaron Kravitz / @arkravitz

09/04/2014 at 09:02AM

11
#328 - Robbie Clarken / @robbieclarken

09/14/2014 at 07:34AM

11
#329 - Giovanni Garufi / @garufi_giovanni

09/14/2014 at 09:31PM

11
#330 - Jose Gutierrez / @Jogusa

09/20/2014 at 06:37AM