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

1658 active golfers, 4777 entries

Leaderboard (lowest score wins):
11
#601 - cyndiii-development / @cyndiiidevelop1

05/02/2020 at 05:30AM

11
#602 - kashikasitaro / @kashikasitaro

05/02/2020 at 05:35AM

11
#603 - インベスターS / @S42197397

05/02/2020 at 05:45AM

11
#604 - Robin Abrahamsson / @rqAbrahamsson

05/02/2020 at 10:35AM

11
#605 - Arthur Goodman / @ArthurGoodman3

05/02/2020 at 03:34PM

11
#606 - samet ぷ / @jssamet

05/09/2020 at 11:04PM

11
#607 - Kevin Keefe / @KevinKeefe5

05/14/2020 at 05:59PM

11
#608 - Ebi / @ehan6

05/21/2020 at 07:11PM

11
#609 - lpf / @yurisses

05/21/2020 at 07:55PM

11
#610 - 于吉星 / @fishermryn

05/27/2020 at 08:09AM

11
#611 - Bob Streams / @BobStreams1

06/01/2020 at 08:33PM

11
#612 - nico / @res_tantum

06/09/2020 at 12:13AM

11
#613 - Michael V. / @mvivirito

06/11/2020 at 09:57PM

11
#614 - Finlay l͓̽o͓̽c͓̽k͓̽e͓̽d͓̽d͓̽o͓̽w͓̽n͓̽ McAfee / @finsqm

06/12/2020 at 03:25PM

11
#615 - Yannick / @Yannick88147038

06/16/2020 at 03:38PM

11
#616 - Romain / @djizeuscoco

06/17/2020 at 12:25PM

11
#617 - Ming Dai / @MingDai2

06/30/2020 at 04:40PM

11
#618 - 大矢元海 / @008Genkai

07/04/2020 at 06:40PM

11
#619 - speisz / @speiszc

07/04/2020 at 09:44PM

11
#620 - dotvimrc / @dotvimrc1

07/28/2020 at 06:16AM

11
#621 - Rustem B. / @_rustemb

07/31/2020 at 12:39PM

11
#622 - Du Phan / @fehiepsi

08/13/2020 at 06:57PM

11
#623 - RockerZZY / @rocker_zzy

08/27/2020 at 02:07PM

11
#624 - Udbhav Muthakana / @udbhavm_

08/28/2020 at 12:05AM

11
#625 - Zach Kirby / @zkirby2020

08/30/2020 at 12:30AM

11
#626 - Andrew McKinlay / @ihavethecon

09/14/2020 at 07:51AM

11
#627 - vim-golf-requirement / @VRequirement

10/07/2020 at 03:50PM

11
#628 - MoreWillMusic / @morewillmusic

10/07/2020 at 03:52PM

11
#629 - lamtt77 / @lamtt77

10/11/2020 at 08:04AM

11
#630 - Arijus / @argshook

10/16/2020 at 01:47PM