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

1517 active golfers, 4342 entries

Leaderboard (lowest score wins):
15
#1291 - Sven Keidel / @jungerkrieger89

08/22/2012 at 08:54PM

15
#1292 - Runar / @runarfu

01/12/2013 at 09:30AM

15
#1293 - n2o4 / @scatotonic

03/17/2013 at 11:39AM

15
#1294 - Endel Dreyer / @endel

06/30/2013 at 04:54AM

15
#1295 - Amin Saeedi / @4M54

07/02/2013 at 07:10PM

15
#1296 - Vincent Lee / @vincentleest

07/04/2013 at 04:59AM

15
#1297 - Test Name / @TestNam40721255

07/28/2013 at 03:58AM

15
#1298 - Bart of Denver / @bartofdenver

08/12/2013 at 01:37PM

15
#1299 - Hachez Floran / @FloranHachez

09/02/2013 at 05:21PM

15
#1300 - Nick Bakkegaard / @Bakkemand

09/18/2013 at 11:35AM

15
#1301 - Tankor Smash / @TankorSmash

10/02/2013 at 03:01PM

15
#1302 - Sami Niiranen / @saminiir

10/13/2013 at 09:47AM

15
#1303 - Liam Wilkins / @CallMeWilkins

10/17/2013 at 07:17AM

15
#1304 - foo / @foo88832727

10/18/2013 at 03:27PM

15
#1305 - Ben Pringle / @pringleben

10/22/2013 at 12:21AM

15
#1306 - Oliver Daniel / @olivermdaniel

11/26/2013 at 03:05AM

15
#1307 - joe smoe / @joesmoevim

12/16/2013 at 10:01PM

15
#1308 - Sagar Rakshe / @sagarrakshe2

12/20/2013 at 02:47AM

15
#1309 - Hanshuo Tan / @tanhanshuo

01/11/2014 at 05:58AM

15
#1310 - Chirag Tailor / @ctailor2

01/27/2014 at 05:33PM

15
#1311 - harper / @harper

01/28/2014 at 06:38PM

15
#1312 - Patrick Nguyen / @ItsPatricko

01/29/2014 at 12:04AM

15
#1313 - Will Laurance 🚲 / @wlaurance

01/29/2014 at 08:26PM

15
#1314 - Andrew Clissold / @aclissold

01/29/2014 at 11:02PM

15
#1315 - Larijohn Adorable / @jbpnoy6fifty

01/31/2014 at 11:03AM

15
#1316 - Fabian Fritz / @zehdeh90

02/03/2014 at 08:11PM

15
#1317 - Levi / @thatguylevi

02/04/2014 at 09:51PM

15
#1318 - Felix Boers / @felixboers

02/13/2014 at 09:11PM

15
#1319 - Joseph Tyler Jones / @josephtyler

02/26/2014 at 12:07AM

15
#1320 - Timothy Lin / @lzh9102

03/07/2014 at 10:59PM