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
#151 - Vasily / @wolvschool

12/20/2019 at 09:18AM

19
#152 - Delon / @delonleonard

12/22/2019 at 07:49AM

19
#153 - rirze / @SourabhWasTaken

12/25/2019 at 02:29AM

19
#154 - sapir malka / @sapir5522

12/26/2019 at 08:43AM

19
#155 - 임덕윤 / @SnLHUF5ZYJXqI1m

12/26/2019 at 08:26PM

19
#156 - Tefe / @tefetic

01/02/2020 at 09:52PM

19
#157 - caffeineism / @caffeineism

01/06/2020 at 03:49AM

19
#158 - nicosierra / @nicosierra84

01/09/2020 at 08:52PM

19
#159 - lev / @nouvelliu

01/10/2020 at 10:29AM

19
#160 - mowglian / @mowglian

01/11/2020 at 02:28PM

19
#161 - Arijus / @argshook

01/17/2020 at 02:50PM

19
#162 - Karnival K / @K4rnival

01/18/2020 at 08:01PM

19
#163 - Tyler Culdler / @culdler

01/19/2020 at 05:38AM

19
#164 - Rune Warhuus / @DinkDonkNorway

01/22/2020 at 11:29AM

19
#165 - おねさわ / @yama846

02/01/2020 at 02:24PM

19
#166 - jrddp / @jrddp0

02/14/2020 at 04:48AM

19
#167 - KingYames / @JamesZeHunter

02/17/2020 at 06:23AM

19
#168 - howanto / @ho_wan_

02/19/2020 at 09:38PM

19
#169 - Mushan Yang / @mushanyoung

02/26/2020 at 02:03AM

19
#170 - eshel / @EshelBM

02/27/2020 at 03:13PM

19
#171 - whale / @Hari84444713

03/01/2020 at 08:01PM

19
#172 - floyd / @floyd10086

03/02/2020 at 03:12AM

19
#173 - countime / @countime1

03/05/2020 at 04:46AM

19
#174 - Matthew / @Burfield12

03/07/2020 at 11:52AM

19
#175 - エターナル雑魚 / @eternalzako

03/08/2020 at 11:23AM

19
#176 - Paul Parker / @PaulDesmoParker

03/09/2020 at 01:36PM

19
#177 - finn.mertens / @finnmer22139082

03/13/2020 at 12:36AM

19
#178 - せいほう / @FICSQF

03/13/2020 at 03:08AM

19
#179 - Marco / @Marco24456514

03/22/2020 at 12:08PM

19
#180 - majo senf / @majo_senf

03/23/2020 at 02:27PM