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):
18
#31 - xtncl / @xtncl

06/10/2022 at 11:51PM

18
#32 - z00master / @z00master

09/03/2022 at 02:00AM

18
#33 - asirago / @asiragoo

12/13/2023 at 08:26AM

18
#34 - erdustiggen / @erdustiggen

01/19/2024 at 12:56PM

18
#35 - philikarus / @philikarus

02/07/2024 at 03:09PM

18
#36 - Paul McDowell / @etothepi16

05/24/2024 at 05:10PM

18
#37 - Aly Thobani / @alythobani

05/31/2024 at 12:03AM

18
#38 - Peppa Pig / @PeppaPigSg

07/19/2024 at 12:34AM

19
#39 - Malcolm Sharpe / @blueblimpms

07/19/2019 at 02:39AM

19
#40 - Norbert / @mullno

07/19/2019 at 05:05AM

19
#41 - Jon Krause / @jkrause314

07/19/2019 at 06:01AM

19
#42 - Saki Gw / @Sakigw

07/19/2019 at 06:55AM

19
#43 - Jan Bundesmann / @janbundesmann

07/19/2019 at 07:58AM

19
#44 - Neil Struthers / @struthersneil

07/19/2019 at 08:41AM

19
#45 - "Smylers" / @Smylers2

07/19/2019 at 09:09AM

19
#46 - Tinko Minko / @tandikula

07/19/2019 at 07:10PM

19
#47 - Jonáš Šerých / @serycjon

07/19/2019 at 08:58PM

19
#48 - taka / @takaoutputblog

07/20/2019 at 01:20AM

19
#49 - Jure Zbontar / @jure_zbontar

07/20/2019 at 03:01AM

19
#50 - Rahul Dhir / @RahulDhir300

07/20/2019 at 05:03AM

19
#51 - Bence Nagy / @underyx

07/20/2019 at 09:27AM

19
#52 - Manan Khattar / @KhattarManan

07/20/2019 at 09:47AM

19
#53 - Hxhxhrra / @hxhxhrra

07/20/2019 at 06:11PM

19
#54 - james_bunch / @james_bunch

07/21/2019 at 05:21AM

19
#55 - asdkljsadladlaldcxmzwqewq / @asdkljsadladla1

07/21/2019 at 07:19AM

19
#56 - Matt Donahoe / @mdonahoe

07/21/2019 at 07:54AM

19
#57 - heppen / @heppen_He

07/21/2019 at 08:45AM

19
#58 - Calum Halpin / @calumhalpin

07/21/2019 at 06:27PM

19
#59 - fisch@emacs / @WingsORC

07/21/2019 at 08:20PM

19
#60 - mkaminaga / @mkmng3

07/22/2019 at 07:05AM