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 5d3122ace2e18c0006b8bc4d

Bad Copy Syntax

Copy should be from right to left, but sometimes you type it wrong.

Start file
   copyRtL(source, destination);
   copyRtL
("John Q. Public", nameVariable);
End file
   copyRtL(destination, source);
   copyRtL
(nameVariable, "John Q. Public");

View Diff

1,2c1,2
<    copyRtL(source, destination);
<    copyRtL("John Q. Public", nameVariable);
---
>    copyRtL(destination, source);
>    copyRtL(nameVariable, "John Q. Public");

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 529 remaining solutions by signing in and submitting your own entry
#530 Urbanovics Péter / @UrbanovicsP - Score: 203 - 08/22/19 @ 11:03
:s/(\(.*)<Left>\<Right>, (.*<BS><BS><BS>\*<BS>(.*\))/<BS>'<BS>\(\2, \1<BS><BS><BS><BS><BS><BS>/2<BS><BS>\2 <BS>, '1<BS><BS>\1)/<Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left>%<Right><Right><Right><Right><Right><Right><Right><Right><Right><CR>:<Up><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><CR>:<Up><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><BS>\<BS>/<CR>:wq<CR>

0 comments


Created by: @BradleySmall

530 active golfers, 2044 entries

Leaderboard (lowest score wins):
49
#511 - Vim Golfer / @VimGolfer6

07/19/2019 at 11:01AM

49
#512 - Scott Smith / @Scottaino

12/20/2019 at 09:53PM

52
#513 - bjarne stroustrup (dj set) / @scarletdenizen

08/02/2019 at 09:22PM

54
#514 - Tri Le / @Tri_Le

07/25/2019 at 11:11PM

55
#515 - Aaron Harris / @TheJoyOfPython

12/09/2019 at 02:31PM

57
#516 - Thomas Edlich / @grumpybavarian

09/27/2019 at 10:56PM

57
#517 - nickGPT / @nickandbro

08/24/2024 at 02:50PM

60
#518 - Marius Ropotica / @cipmar

04/02/2024 at 06:20PM

61
#519 - cadsds / @cadsds

03/31/2025 at 11:54AM

62
#520 - Stephen Westhead / @CraziCrow

10/08/2019 at 03:39PM

62
#521 - Alvaro Melendez / @alvaromelendezh

02/21/2020 at 05:54PM

69
#522 - dahara / @kuma_moooon

08/06/2019 at 03:34PM

74
#523 - Paul Teehan / @paulteehan

07/26/2019 at 01:51PM

76
#524 - KlondikeBaer / @BaerKlondike

10/13/2019 at 04:54PM

76
#525 - Nala Nil / @nala_nil

02/12/2020 at 03:55PM

78
#526 - Ozzy Walsh / @Novigradian

08/02/2019 at 09:22AM

84
#527 - Sarim Aleem / @AleemSarim

06/23/2021 at 06:50PM

140
#528 - Martin Huter / @marhat87

02/05/2020 at 12:16PM

149
#529 - Cnetwork / @WShuguang

11/08/2019 at 07:40AM

203
#530 - Urbanovics Péter / @UrbanovicsP

08/22/2019 at 11:03AM