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 588 remaining solutions by signing in and submitting your own entry
#589 🎱 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

589 active golfers, 1843 entries

Leaderboard (lowest score wins):
12
#241 - Mauro Persano / @fzort

11/16/2014 at 08:05PM

12
#242 - mark0829 / @mark0829

02/02/2015 at 08:30AM

12
#243 - xieyh11 / @xieyh11

02/28/2015 at 03:29AM

12
#244 - pftb12345 / @pftb12345

04/02/2015 at 02:55AM

12
#245 - Evan Coleman / @edc1591

05/14/2015 at 02:49PM

12
#246 - Clark DuVall / @theclarkatron

05/25/2015 at 10:25PM

12
#247 - Robert Robertson / @RobertC3228687

06/16/2015 at 08:04PM

12
#248 - Skúli Jóhannsson / @skulibj

06/26/2015 at 10:16PM

12
#249 - No Holiness / @NoHoliness

10/03/2015 at 10:33AM

12
#250 - randomizer user / @alsdkfhjlkadfha

10/20/2015 at 10:54AM

12
#251 - kiou / @smallletterquu

12/05/2015 at 01:25AM

12
#252 - Ian Trophy / @prfrgg

02/01/2016 at 12:13PM

12
#253 - Andrii Maksai / @AMaksai

02/02/2016 at 05:08PM

12
#254 - Jaron Hamlik / @jdhamlik

02/27/2016 at 11:45PM

12
#255 - Michael Potter / @MicLeviPotter

03/08/2016 at 08:23PM

12
#256 - Dimitar Dimitrov / @kurkale6ka

03/15/2016 at 02:31PM

12
#257 - Chenut Ludovic / @7Brwa7

04/05/2016 at 12:24PM

12
#258 - tPenguinLTG / @tpenguinltg

05/15/2016 at 07:01AM

12
#259 - Andres Araya / @arayaandresfco

05/25/2016 at 03:40AM

12
#260 - Lifepillar / @lifepillar

06/08/2016 at 08:25PM

12
#261 - Ram Tamtam / @ramtamtamtam

06/29/2016 at 01:22PM

12
#262 - TweetDreams / @TweetMusicians

10/12/2016 at 02:18AM

12
#263 - AODQ / @AODQIG

11/27/2016 at 02:07AM

12
#264 - BlackCap / @BlackCapCoder

11/30/2016 at 12:38PM

12
#265 - Marcin / @Marcin89439917

12/31/2016 at 12:21AM

12
#266 - Yann / @yannstad

02/25/2017 at 07:30AM

12
#267 - Reinaldo Astudillo / @astudillor

03/23/2017 at 12:00AM

12
#268 - Solomon / @Trugbildjaeger

03/31/2017 at 06:03AM

12
#269 - Carl Egbert / @CarlOEgbert

06/13/2017 at 12:56AM

12
#270 - Ben Hill / @KaizenSoze70

06/30/2017 at 09:19PM