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 665 remaining solutions by signing in and submitting your own entry
#666 openbrackett / @openbrackett - Score: 110 - 04/15/24 @ 13:45
wwwvwhdlll<BS>i<BS><BS><Esc>lllli<50-53>vimgolf put 4fcccb70024f950001000026<Esc>[201~<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><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS>, <Esc>p<Esc>:w<CR>:q<CR>

0 comments


Created by: @Ajnasz

666 active golfers, 2147 entries

Leaderboard (lowest score wins):
12
#271 - mark0829 / @mark0829

02/02/2015 at 08:30AM

12
#272 - xieyh11 / @xieyh11

02/28/2015 at 03:29AM

12
#273 - pftb12345 / @pftb12345

04/02/2015 at 02:55AM

12
#274 - Evan Coleman / @edc1591

05/14/2015 at 02:49PM

12
#275 - Clark DuVall / @theclarkatron

05/25/2015 at 10:25PM

12
#276 - Robert Robertson / @RobertC3228687

06/16/2015 at 08:04PM

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

06/26/2015 at 10:16PM

12
#278 - No Holiness / @NoHoliness

10/03/2015 at 10:33AM

12
#279 - randomizer user / @alsdkfhjlkadfha

10/20/2015 at 10:54AM

12
#280 - kiou / @smallletterquu

12/05/2015 at 01:25AM

12
#281 - Ian Trophy / @prfrgg

02/01/2016 at 12:13PM

12
#282 - Andrii Maksai / @AMaksai

02/02/2016 at 05:08PM

12
#283 - Jaron Hamlik / @jdhamlik

02/27/2016 at 11:45PM

12
#284 - Michael Potter / @MicLeviPotter

03/08/2016 at 08:23PM

12
#285 - Dimitar Dimitrov / @kurkale6ka

03/15/2016 at 02:31PM

12
#286 - Chenut Ludovic / @7Brwa7

04/05/2016 at 12:24PM

12
#287 - tPenguinLTG / @tpenguinltg

05/15/2016 at 07:01AM

12
#288 - Andres Araya / @arayaandresfco

05/25/2016 at 03:40AM

12
#289 - Lifepillar / @lifepillar

06/08/2016 at 08:25PM

12
#290 - Ram Tamtam / @ramtamtamtam

06/29/2016 at 01:22PM

12
#291 - TweetDreams / @TweetMusicians

10/12/2016 at 02:18AM

12
#292 - AODQ / @AODQIG

11/27/2016 at 02:07AM

12
#293 - BlackCap / @BlackCapCoder

11/30/2016 at 12:38PM

12
#294 - Marcin / @Marcin89439917

12/31/2016 at 12:21AM

12
#295 - Yann / @yannstad

02/25/2017 at 07:30AM

12
#296 - Reinaldo Astudillo / @astudillor

03/23/2017 at 12:00AM

12
#297 - Solomon / @Trugbildjaeger

03/31/2017 at 06:03AM

12
#298 - Carl Egbert / @CarlOEgbert

06/13/2017 at 12:56AM

12
#299 - Ben Hill / @KaizenSoze70

06/30/2017 at 09:19PM

12
#300 - Brian Hall / @_bruab_

07/20/2017 at 03:06PM