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):
11
#181 - Scott Atkins / @scottrick49

07/23/2021 at 02:13PM

11
#182 - Nick Repetti / @nick_repetti

09/21/2021 at 06:35PM

11
#183 - russellzhaomao / @russellzhaomao

05/25/2022 at 09:27AM

11
#184 - Alex / @AlexanderHeatl2

06/03/2022 at 09:40PM

11
#185 - Qing Liu / @poeminlash

08/13/2022 at 10:16PM

11
#186 - Brandon / @Brandon10678836

08/31/2022 at 01:53PM

11
#187 - Janzen / @__Coos

09/26/2022 at 07:52AM

11
#188 - 咸糖🎯 / @GIA917229015

07/13/2023 at 04:07PM

11
#189 - asirago / @asiragoo

12/12/2023 at 11:53PM

11
#190 - Remus Dalrymple / @bornintheflames

12/13/2023 at 09:18PM

11
#191 - sosa-daniel / @sosa-daniel

12/29/2023 at 07:02PM

11
#192 - jeffreymrussell / @jeffreymrussell

03/12/2024 at 11:24AM

11
#193 - Jonathan El-Khoury / @jonoelk

04/12/2024 at 05:35AM

11
#194 - nickGPT / @nickandbro

08/28/2024 at 08:49PM

11
#195 - Suhaib Murshid / @suhaibm

09/07/2024 at 05:42AM

11
#196 - Peppa Pig / @PeppaPigSg

10/10/2024 at 02:39AM

11
#197 - Pim / @Pireax

11/12/2024 at 12:03AM

11
#198 - Pablo Acuna / @pacuna

11/16/2024 at 01:51AM

12
#199 - Sebastian Kusnier / @skusnier

06/04/2012 at 05:12PM

12
#200 - Simon Nicolussi / @sinic

06/04/2012 at 05:15PM

12
#201 - Rod Knowlton / @codelahoma

06/04/2012 at 11:50PM

12
#202 - Kerson Hsiao / @KersonHsiao

06/05/2012 at 01:49AM

12
#203 - Evgeny Persienko / @zzazab

06/05/2012 at 04:10AM

12
#204 - Pawel Obrok / @mrYapee

06/05/2012 at 09:03AM

12
#205 - Curtis Cooley / @CurtisRCooley

06/05/2012 at 08:48PM

12
#206 - Benson Kim / @BensonRLA

06/06/2012 at 09:35AM

12
#207 - じょんあば / @john_ababa

06/06/2012 at 02:47PM

12
#208 - Tadas Sce / @tadassce

06/10/2012 at 08:35PM

12
#209 - Simian Apey / @SimianApey

06/12/2012 at 08:10AM

12
#210 - Matt Walker / @_walkermatt

06/18/2012 at 04:39PM