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 @nickandbro:

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

663 active golfers, 2139 entries

Solutions by @nickandbro:
11
#194 - nickGPT / @nickandbro

08/28/2024 at 08:49PM

12
#>336 - nickGPT / @nickandbro

08/28/2024 at 08:48PM

13
#>430 - nickGPT / @nickandbro

08/28/2024 at 08:48PM

14
#>518 - nickGPT / @nickandbro

08/28/2024 at 08:48PM

15
#>580 - nickGPT / @nickandbro

08/28/2024 at 08:48PM

16
#>616 - nickGPT / @nickandbro

08/28/2024 at 08:48PM

17
#>626 - nickGPT / @nickandbro

08/28/2024 at 08:48PM

18
#>633 - nickGPT / @nickandbro

08/28/2024 at 08:48PM

19
#>639 - nickGPT / @nickandbro

08/28/2024 at 08:48PM

20
#>640 - nickGPT / @nickandbro

08/28/2024 at 08:48PM

23
#>647 - nickGPT / @nickandbro

08/28/2024 at 08:48PM

25
#>650 - nickGPT / @nickandbro

08/28/2024 at 08:48PM

26
#>652 - nickGPT / @nickandbro

08/28/2024 at 08:48PM

27
#>654 - nickGPT / @nickandbro

08/28/2024 at 08:48PM

28
#>657 - nickGPT / @nickandbro

08/28/2024 at 08:47PM

31
#>658 - nickGPT / @nickandbro

08/28/2024 at 08:47PM

33
#>659 - nickGPT / @nickandbro

08/28/2024 at 08:47PM

47
#>660 - nickGPT / @nickandbro

08/28/2024 at 08:47PM

48
#>661 - nickGPT / @nickandbro

08/28/2024 at 08:47PM

54
#>661 - nickGPT / @nickandbro

08/28/2024 at 08:47PM