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):
16
#1381 - Hendrik Lammers / @hendriklammers

06/14/2014 at 05:15PM

16
#1382 - Herr Oppermann / @HerrOppermann

06/15/2014 at 02:22PM

16
#1383 - liz monfett / @lizmonfett

07/05/2014 at 04:38AM

16
#1384 - AA / @stonewareslord

07/16/2014 at 03:27AM

16
#1385 - Jake Worth / @jwworth

11/23/2014 at 12:49AM

16
#1386 - Tact Overflow / @muppling

01/07/2015 at 01:35PM

16
#1387 - Dhuan!! / @sigadhuan

03/21/2015 at 04:29PM

16
#1388 - Chris Grantham / @crgrantham

11/30/2015 at 04:34PM

16
#1389 - kekke / @kekke859

01/23/2016 at 12:27PM

16
#1390 - Stop and think / @ms_uncountable

07/06/2017 at 07:17AM

16
#1391 - Bhatta Sushmith / @bsushmith

08/23/2017 at 08:28PM

16
#1392 - Paul Egy / @egy_paul

07/27/2018 at 04:14PM

16
#1393 - Daichi / @daichi1014

08/16/2018 at 03:53AM

16
#1394 - Anon / @Anon47554934

08/23/2018 at 02:13PM

16
#1395 - Laurent Atlan / @laurentatlan1

04/13/2019 at 11:50PM

16
#1396 - alaric27 / @alaric273

07/11/2019 at 08:54AM

17
#1397 - Bjørn Einar Bjartnes / @bjartnes

01/27/2012 at 12:19PM

17
#1398 - Quasar Jarosz / @quasarj

01/31/2012 at 08:11PM

17
#1399 - Thierry Régagnon / @Thierry

03/12/2012 at 11:24AM

17
#1400 - Leon Miller-Out / @leonmo

03/15/2012 at 02:03AM

17
#1401 - jwrigh13 / @jwrigh13

04/19/2012 at 09:55PM

17
#1402 - うえっち / @uh_tomo

12/04/2012 at 04:16PM

17
#1403 - wtnb / @_kenichirow

04/05/2013 at 04:08PM

17
#1404 - George GZ Zakhour / @AlloGeorge

06/25/2013 at 07:46AM

17
#1405 - Todd Branchflower / @toddbranch

07/16/2013 at 11:50PM

17
#1406 - Kenny Sawyer / @ksawyerwsu

07/25/2013 at 06:36AM

17
#1407 - Larry Boltovskoi / @larrybolt

12/08/2013 at 01:14AM

17
#1408 - Tudor Barbu / @motanelu

12/12/2013 at 12:07PM

17
#1409 - Jatin Naik / @tinygrasshopper

01/23/2014 at 07:38PM

17
#1410 - makuchy / @makuchy

02/01/2014 at 12:38PM