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 by @jonoelk:

Unlock 9 remaining solutions by signing in and submitting your own entry
Created by: @Ajnasz

663 active golfers, 2139 entries

Solutions by @jonoelk:
11
#193 - Jonathan El-Khoury / @jonoelk

04/12/2024 at 05:35AM

12
#>334 - Jonathan El-Khoury / @jonoelk

04/12/2024 at 05:33AM

12
#>334 - Jonathan El-Khoury / @jonoelk

04/12/2024 at 05:33AM

13
#>429 - Jonathan El-Khoury / @jonoelk

04/12/2024 at 05:32AM

14
#>518 - Jonathan El-Khoury / @jonoelk

04/12/2024 at 05:31AM

15
#>579 - Jonathan El-Khoury / @jonoelk

04/12/2024 at 05:29AM

16
#>616 - Jonathan El-Khoury / @jonoelk

04/12/2024 at 05:28AM

17
#>626 - Jonathan El-Khoury / @jonoelk

04/12/2024 at 05:26AM

22
#>645 - Jonathan El-Khoury / @jonoelk

04/12/2024 at 05:24AM