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):
21
#301 - ぼとぼと / @boto_voto

08/16/2020 at 05:46AM

21
#302 - Demian Martinez / @demianuco

11/02/2020 at 08:59AM

21
#303 - Filipe 💙 / @ABarroso

11/07/2020 at 11:32AM

21
#304 - Gytis Vinclovas / @GytisVinclovas

01/26/2021 at 07:42AM

21
#305 - someone / @IKvacenok

06/15/2023 at 07:30PM

21
#306 - quasineutral / @quasineutral

08/10/2023 at 11:31AM

21
#307 - Pim / @Pireax

11/08/2024 at 12:12AM

21
#308 - Pablo Acuna / @pacuna

11/14/2024 at 12:19AM

22
#309 - Jeff Schomay / @jschomay

07/21/2019 at 05:05PM

22
#310 - Maor Leger / @maor_leger

07/21/2019 at 06:25PM

22
#311 - Danny T / @son_of_torkel

07/28/2019 at 09:44PM

22
#312 - Mark / @markfilus

07/29/2019 at 06:05PM

22
#313 - daniel / @daniel31464605

08/12/2019 at 07:36AM

22
#314 - Wistan Chou / @wisty97

08/15/2019 at 02:19AM

22
#315 - vim_ninja / @NinjaVim

08/25/2019 at 11:13PM

22
#316 - will / @willpnw

09/04/2019 at 03:01AM

22
#317 - Benjamin Pelletier / @benjipelletier

09/24/2019 at 02:14PM

22
#318 - Devistator / @Devistator5

10/08/2019 at 10:18AM

22
#319 - Jonathan Eidsness / @jonathaneidsnes

10/09/2019 at 04:25PM

22
#320 - Alex Schultz / @Pumpkinhead002

10/17/2019 at 02:55PM

22
#321 - two failing clusters in a trench coat / @0x12b

10/18/2019 at 10:29PM

22
#322 - yawryck / @yawryck

10/22/2019 at 01:44AM

22
#323 - Robert Clark / @rsclark2

10/25/2019 at 06:31PM

22
#324 - Harrison / @ardentcow

10/31/2019 at 03:18AM

22
#325 - mogitate / @mutemeat

11/14/2019 at 01:57PM

22
#326 - Dan Kilman / @dan_kilman

12/18/2019 at 04:56PM

22
#327 - Ali Kero / @stochastist

02/14/2020 at 07:09AM

22
#328 - Steffen / @Pions90

02/14/2020 at 04:03PM

22
#329 - golferN / @golferN3

02/25/2020 at 09:08PM

22
#330 - Aioriya / @AioriyaDonk

03/11/2020 at 02:36AM