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):
19
#211 - Scott Berger / @scottberger

09/25/2021 at 05:51PM

19
#212 - Humbaba / @humbabu

01/09/2022 at 07:24PM

19
#213 - Youssef Magdy / @youssef_magdy29

05/01/2022 at 02:00AM

19
#214 - dorianm / @dorianm

05/09/2022 at 01:19AM

19
#215 - }(⇒){ / @TangerinePlank

06/18/2022 at 06:20AM

19
#216 - Janzen / @__Coos

10/04/2022 at 12:47PM

19
#217 - e_e / @eleloi

02/14/2023 at 10:42PM

19
#218 - Chippy ash / @_rayrain

02/19/2023 at 03:20AM

19
#219 - 7733865@qq.com / @tjxwg

06/13/2023 at 02:22AM

19
#220 - moh ayaya / @AyayaMoh

09/04/2023 at 08:04PM

19
#221 - Luoyb / @Luoyb

10/28/2023 at 07:45AM

19
#222 - EtherFan / @ether_fan

02/27/2024 at 06:56PM

19
#223 - Chris Brown / @engineercyb

09/18/2024 at 08:55PM

20
#224 - Derek Schrock / @derekschrock

07/19/2019 at 02:34AM

20
#225 - Bradley M. Small / @BradleySmall

07/19/2019 at 03:16AM

20
#226 - mrrdl / @mrrdl5

07/19/2019 at 08:50PM

20
#227 - garry quested / @GQuested

07/20/2019 at 12:38PM

20
#228 - Jon Miller / @jmillxyz

07/21/2019 at 06:45PM

20
#229 - vana / @vana15129217

07/22/2019 at 11:35AM

20
#230 - Walker Boh / @walker_boh

07/22/2019 at 12:37PM

20
#231 - John Contad ᜉᜎ᜔o / @JohnContad

07/25/2019 at 06:34AM

20
#232 - Jonathan Browning / @yungjig90

07/30/2019 at 12:12AM

20
#233 - matthew brett / @matthewbrett

08/07/2019 at 04:42AM

20
#234 - André Reigoto / @AndreReigoto

08/08/2019 at 02:46AM

20
#235 - Peter Demin / @peterdemin

08/08/2019 at 05:37PM

20
#236 - averageRandomPerson / @averageRandomP1

08/26/2019 at 12:06AM

20
#237 - lucca augusto / @LuccaAugusto6

10/05/2019 at 04:57PM

20
#238 - Michał Łowicki / @mlowicki

10/05/2019 at 09:26PM

20
#239 - arsi arola / @mos_kiitto

10/18/2019 at 10:45AM

20
#240 - Saher El-Neklawy / @saherneklawy

10/22/2019 at 11:54AM