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
#181 - antoine mas / @aneomas

03/25/2020 at 11:43AM

19
#182 - bluemartian / @bluemartianz59

03/27/2020 at 07:00PM

19
#183 - Nathan Hartman / @hnathan918

04/02/2020 at 04:30PM

19
#184 - RaylanFox / @RaylanFox

04/06/2020 at 08:24AM

19
#185 - mury liang / @muryliang

04/07/2020 at 02:14PM

19
#186 - edvrds / @edvrds

04/13/2020 at 07:08PM

19
#187 - Moatvald / @moatvald

04/15/2020 at 05:37PM

19
#188 - John Sumner / @rjsumner

04/28/2020 at 04:21PM

19
#189 - Arthur Goodman / @ArthurGoodman3

04/29/2020 at 09:42PM

19
#190 - Kevin Keefe / @KevinKeefe5

05/20/2020 at 04:30PM

19
#191 - 于吉星 / @fishermryn

05/23/2020 at 12:21PM

19
#192 - samet ぷ / @jssamet

05/28/2020 at 02:48PM

19
#193 - Valdimar / @genkobar

06/01/2020 at 08:42AM

19
#194 - Robberechts Arne / @ArneRobberechts

06/14/2020 at 07:17PM

19
#195 - smlbrngr / @smlbrngr

06/15/2020 at 06:43PM

19
#196 - speisz / @speiszc

06/27/2020 at 11:01PM

19
#197 - mocihan / @mocihan

06/29/2020 at 03:04PM

19
#198 - Alexandre MERLIN / @AlxMerlin

07/03/2020 at 07:35AM

19
#199 - Mitchell Horning / @HorningMitchell

07/07/2020 at 02:27PM

19
#200 - 大矢元海 / @008Genkai

07/07/2020 at 08:47PM

19
#201 - PK / @pkeugine

07/15/2020 at 02:21PM

19
#202 - Виталий Макаров / @avada_keda_bra

07/24/2020 at 03:55PM

19
#203 - GenericHardwareGamer / @GnrikHrdwrGamer

08/06/2020 at 10:20PM

19
#204 - Theo Sarrazin / @tshaero

08/20/2020 at 06:56AM

19
#205 - AAbraxas / @AAbraxas1

10/13/2020 at 08:19PM

19
#206 - quemeraisc / @quemeraisc

11/23/2020 at 01:42PM

19
#207 - hepebexè / @hepebexe

11/28/2020 at 08:38PM

19
#208 - chocolate / @chocola81394123

01/06/2021 at 07:05AM

19
#209 - Michel Viktor / @tomkpz

07/31/2021 at 11:17PM

19
#210 - yancy / @yancy_dong

09/17/2021 at 09:55AM