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

627 active golfers, 1982 entries

Leaderboard (lowest score wins):
12
#271 - Dimitar Dimitrov / @kurkale6ka

03/15/2016 at 02:31PM

12
#272 - Chenut Ludovic / @7Brwa7

04/05/2016 at 12:24PM

12
#273 - tPenguinLTG / @tpenguinltg

05/15/2016 at 07:01AM

12
#274 - Andres Araya / @arayaandresfco

05/25/2016 at 03:40AM

12
#275 - Lifepillar / @lifepillar

06/08/2016 at 08:25PM

12
#276 - Ram Tamtam / @ramtamtamtam

06/29/2016 at 01:22PM

12
#277 - TweetDreams / @TweetMusicians

10/12/2016 at 02:18AM

12
#278 - AODQ / @AODQIG

11/27/2016 at 02:07AM

12
#279 - BlackCap / @BlackCapCoder

11/30/2016 at 12:38PM

12
#280 - Marcin / @Marcin89439917

12/31/2016 at 12:21AM

12
#281 - Yann / @yannstad

02/25/2017 at 07:30AM

12
#282 - Reinaldo Astudillo / @astudillor

03/23/2017 at 12:00AM

12
#283 - Solomon / @Trugbildjaeger

03/31/2017 at 06:03AM

12
#284 - Carl Egbert / @CarlOEgbert

06/13/2017 at 12:56AM

12
#285 - Ben Hill / @KaizenSoze70

06/30/2017 at 09:19PM

12
#286 - Brian Hall / @_bruab_

07/20/2017 at 03:06PM

12
#287 - xyz / @menhej

02/03/2018 at 12:30PM

12
#288 - 石奕心 / @allenshih1

06/07/2018 at 03:43AM

12
#289 - Ryan Connolly / @ryanconnnolly

06/23/2018 at 09:56AM

12
#290 - Apox / @apox159

07/20/2018 at 08:01PM

12
#291 - qed / @qed13308565

07/25/2018 at 04:47PM

12
#292 - Guirec CORBEL / @GuirecCorbel

09/09/2018 at 07:24PM

12
#293 - chaotic / @laersn

09/11/2018 at 11:24AM

12
#294 - Robin De Mol / @RobinDeMol

09/14/2018 at 09:28AM

12
#295 - Kasparas Lavrukaitis / @kaslvr

11/09/2018 at 03:54PM

12
#296 - Homer Simp12586 / @simp12586

11/18/2018 at 06:58PM

12
#297 - Mihai / @mihaicristiant

12/08/2018 at 01:04PM

12
#298 - Bruno Cunha / @bruncun

12/19/2018 at 12:59AM

12
#299 - Mateen Ulhaq / @sicariusnoctis

02/15/2019 at 04:25AM

12
#300 - Chester Yap / @Chest_ErYap

07/29/2019 at 12:23AM