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):
31
#661 - JR Tashjian / @jrtashjian

04/18/2013 at 05:49PM

33
#662 - Jan Wedekind / @wedesoft

07/12/2012 at 09:43PM

47
#663 - DK / @scelerat

01/28/2014 at 07:51PM

48
#664 - Jurica / @Jurica34581259

11/16/2018 at 01:44PM

63
#665 - 🎱 Josh Branchaud 🔥 / @jbrancha

08/24/2016 at 01:02AM

110
#666 - openbrackett / @openbrackett

04/15/2024 at 01:45PM