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 4fcccb70024f950001000026

Switch function arguments

How to switch two arguments of a function.

Start file
function testFunction (foo, bar) {
}
End file
function testFunction (bar, foo) {
}

View Diff

1c1
< function testFunction (foo, bar) {
---
> function testFunction (bar, foo) {

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 590 remaining solutions by signing in and submitting your own entry
#591 🎱 Josh Branchaud 🔥 / @jbrancha - Score: 63 - 08/24/16 @ 01:02
:s<BS><BS>ffvi(:s/\w{3}, <BS><BS><BS><BS><BS><BS>(\w*\), \w<BS>(\w*\)\\2, <BS><BS><BS><BS><BS>/\2, \1/<CR>ZZ

0 comments


Created by: @Ajnasz

591 active golfers, 1850 entries

Leaderboard (lowest score wins):
11
#151 - martin tourneboeuf / @martintournebo1

06/19/2018 at 08:50PM

11
#152 - Daniël De Koker / @daniel_koker

06/27/2018 at 10:15AM

11
#153 - Tommaso Laurenzi / @TommasoLaurenzi

07/03/2018 at 09:07PM

11
#154 - fucus / @fishlovebanana

08/12/2018 at 03:28AM

11
#155 - fsj / @FrogzSJ

08/12/2018 at 09:03AM

11
#156 - Hugo / @szeyattai

08/23/2018 at 09:13AM

11
#157 - Sxcy / @SxcyX

10/22/2018 at 09:02PM

11
#158 - Dima Matrohin / @wo_ogy

10/27/2018 at 11:38AM

11
#159 - Dax / @zacoxi

11/13/2018 at 08:25AM

11
#160 - name / @name65894813

11/21/2018 at 11:55PM

11
#161 - faisal / @faisalhackshah

11/26/2018 at 06:49PM

11
#162 - alekfed / @alek_fed

04/15/2019 at 02:58PM

11
#163 - Vimfiz / @vimfiz

04/26/2019 at 05:09PM

11
#164 - Grant / @grant_7788

05/13/2019 at 08:49AM

11
#165 - Дима / @dimkino

05/31/2019 at 10:14AM

11
#166 - majo senf / @majo_senf

06/18/2019 at 01:33PM

11
#167 - Jason Chen / @chezbgone

07/04/2019 at 07:53AM

11
#168 - Miłosz Łakomy / @foobar01123

08/23/2019 at 02:57PM

11
#169 - Cassandra / @kascein

09/17/2019 at 07:57PM

11
#170 - Melvin Cheung / @MelvinCheung

11/10/2019 at 04:27PM

12
#171 - Sebastian Kusnier / @skusnier

06/04/2012 at 05:12PM

12
#172 - Simon Nicolussi / @sinic

06/04/2012 at 05:15PM

12
#173 - Rod Knowlton / @codelahoma

06/04/2012 at 11:50PM

12
#174 - Kerson Hsiao / @KersonHsiao

06/05/2012 at 01:49AM

12
#175 - Evgeny Persienko / @zzazab

06/05/2012 at 04:10AM

12
#176 - Pawel Obrok / @mrYapee

06/05/2012 at 09:03AM

12
#177 - Curtis Cooley / @CurtisRCooley

06/05/2012 at 08:48PM

12
#178 - Benson Kim / @BensonRLA

06/06/2012 at 09:35AM

12
#179 - 無ん垢の叫び / @john_ababa

06/06/2012 at 02:47PM

12
#180 - Tadas Sce / @tadassce

06/10/2012 at 08:35PM