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

592 active golfers, 1852 entries

Leaderboard (lowest score wins):
11
#121 - jackliusr / @jackliusr

01/14/2016 at 07:41AM

11
#122 - Aleksey Zhidkov / @AlexeyZhidkov

02/15/2016 at 05:21AM

11
#123 - James Burns / @James_Ian_Burns

02/20/2016 at 08:33PM

11
#124 - Roberto Carraretto / @robcarraretto

02/28/2016 at 12:25PM

11
#125 - Artur Kęsik / @arturkesik

06/24/2016 at 01:12PM

11
#126 - Ameen P / @Ameen_P1

06/25/2016 at 06:18PM

11
#127 - Maxim Semikin / @O_caliber_O

07/18/2016 at 08:38PM

11
#128 - Luke Was / @acatalepteron

08/13/2016 at 03:05AM

11
#129 - Will / @obiwan__k3n00bi

08/17/2016 at 04:15AM

11
#130 - Caroline / @carokenworthy

08/24/2016 at 01:05AM

11
#131 - jdupont655 / @jdupont655

09/05/2016 at 10:45PM

11
#132 - Stephen Aument / @saument

09/06/2016 at 03:14AM

11
#133 - trx / @trxdbg

10/17/2016 at 11:43AM

11
#134 - Bill Ruddock / @biinari

10/26/2016 at 02:34AM

11
#135 - Pierre Maoui / @poupougnac

12/28/2016 at 12:07PM

11
#136 - Christopher Erin / @MCNormalMode

01/18/2017 at 01:41AM

11
#137 - Daniel / @Daniel00288663

03/22/2017 at 10:32AM

11
#138 - 梧桐王子 / @WutongYujie

05/07/2017 at 03:35AM

11
#139 - Jeff Kelly / @cheibriados

06/03/2017 at 06:44AM

11
#140 - John Smith / @johns32768

06/17/2017 at 04:36PM

11
#141 - Bennett Bernardoni / @BBernardoni

07/03/2017 at 08:47PM

11
#142 - Darren Weston / @dazWestonUK

08/29/2017 at 04:53PM

11
#143 - Turkey Man / @lvturkeyman

11/11/2017 at 05:52PM

11
#144 - Eric Liao / @rcliaodev

12/06/2017 at 07:38PM

11
#145 - BarbaJol / @drpproteus

12/31/2017 at 02:19PM

11
#146 - Arijus / @argshook

02/05/2018 at 12:33PM

11
#147 - ParasamGateZero / @ParasamGateZero

02/15/2018 at 10:16AM

11
#148 - GreenPinguin / @GreenPinguin2

04/24/2018 at 10:18AM

11
#149 - DHM / @DHM29978992

04/25/2018 at 12:48AM

11
#150 - 中野 彰 / @M__tech

05/31/2018 at 01:09AM