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 56680033ac11043d6306aa07

Replace and keep the case

Replace all instance of plugin and Plugin to device and Device.

Start file
 def plugin
    @plugin, @plugin_found_by = [Plugin.find_by_uid(@plugin_id), :uid] unless @plugin
    @plugin, @plugin_found_by = [Plugin.find_by_aid(@plugin_id), :aid] unless @plugin
    @plugin
 end
End file
 def device
    @device, @device_found_by = [Device.find_by_uid(@device_id), :uid] unless @device
    @device, @device_found_by = [Device.find_by_uid(@device_id), :uid] unless @device
    @device
 end

View Diff

1,4c1,4
<  def plugin
<     @plugin, @plugin_found_by = [Plugin.find_by_uid(@plugin_id), :uid] unless @plugin
<     @plugin, @plugin_found_by = [Plugin.find_by_aid(@plugin_id), :aid] unless @plugin
<     @plugin
---
>  def device
>     @device, @device_found_by = [Device.find_by_uid(@device_id), :uid] unless @device
>     @device, @device_found_by = [Device.find_by_uid(@device_id), :uid] unless @device
>     @device

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 70 remaining solutions by signing in and submitting your own entry
#71 Lindsay Swift / _lindsai_ - Score: 32 - 01/21/16 @ 22:26
:%s/plugin/device/g<CR>/[<CR>l~YpjddZZ

0 comments

#72 Durga Swaroop Perla / durgaswaroop - Score: 32 - 02/03/16 @ 12:50
:%s/plugin/device/g<CR>/[<CR>l~YpjddZZ

0 comments

#73 george iv / geowa4 - Score: 32 - 05/16/16 @ 00:28
:%s/plugin/device/g<CR>/[<CR>l~yyjVpZZ

0 comments

#74 Sean Stout / s183s657 - Score: 33 - 12/09/15 @ 20:05
:%s/.lugin/device/g<CR>2kf[l~YpjddZZ

0 comments

#75 swordgard / swordgardctf - Score: 34 - 12/10/15 @ 22:36
:$<BS>%s/.lugin/device/g<CR>kddkf[~~YpZZ

0 comments

#76 Etienne Tremel / etiennetremel - Score: 34 - 02/07/16 @ 11:20
:%s/plugin/device/g<CR>2k4fdrDYpjddZZ

0 comments

#77 Oliver Christ / 0liverChrist - Score: 36 - 07/12/16 @ 22:49
:%s/plugin/device/g<CR>kf[l<C-V>k~jfaru;.ZZ

0 comments

#78 twenty2twoss / twenty2twoss - Score: 37 - 01/05/16 @ 18:31
:%s/plugin/device/g<CR>/[<CR>l~jh.farufa.ZZ

0 comments

#79 Corne vd Plas / CornePlas - Score: 39 - 12/14/15 @ 11:46
:%s/plugin/device/g<CR>k:s/a/u/g<CR>3WlrDk.ZZ

0 comments

#80 Wilmer Bandres / WilmerBandres - Score: 40 - 12/11/15 @ 00:32
:%s/plugin/device/ig<CR><Up><Up>f[<Right>rD<Left>yf]<Down>P<Right>df]ZZ

0 comments

#81 noname / banxjal2 - Score: 40 - 02/05/16 @ 17:03
:%s/plugin/device/g<CR>k:s/a/u/g<CR>%%lrDkrDZZ

0 comments

#82 Mikołaj Morzy / MikolajMorzy - Score: 42 - 12/15/15 @ 16:13
:%s/ai/ui/g<CR>:%s/plugin/device/g<CR>?[<CR>l~kh~ZZ

0 comments

#83 coryknapp / coryknapp - Score: 48 - 12/09/15 @ 17:25
:%s:plugin:device:g<CR>:%s:\[d:\[D<CR>:%s:ai:ut<BS>i:g<CR>ZZ

0 comments

#84 Hank Chinaski / uktechman - Score: 48 - 04/26/16 @ 08:47
:%s/ai/ui/g<CR>:%s/plugin/device/g<CR>:%s/\[d/\[D/g<CR>ZZ

0 comments

#85 Christopher Wells / ExcaliburZero_Z - Score: 52 - 12/19/15 @ 04:59
:%s/Plugin/Device/g<CR>:%s/plugin/device/g<CR>/aid<CR>runruZZ

0 comments

#86 full name / caeken1 - Score: 58 - 02/15/16 @ 23:12
:%s:.lugin:device:g<CR>2kf[l<C-V>j~:<Up><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS>aid:uid:g<CR>:x<CR>

0 comments

#87 Jakob Schöttl / jschoettl - Score: 64 - 12/20/15 @ 00:43
:set noic<CR>:s<BS>%s/plugin/device/g<CR>:<Up><Left><Left><Left><Left><Left><Left><Left><BS>D<Left><Left><Left><Left><Left><Left><Left><BS>P<End><CR>faru;.:wq<CR>

0 comments

#88 El Achèche ANIS / elacheche - Score: 74 - 12/10/15 @ 20:38
:%s/Plugin/Device/g<CR>:<Up><Left><Left><Left><Left><Left><Left><Left><BS>d<Left><Left><Left><Left><Left><Left><Left><BS>p<End><CR>:<Up><Left><Left><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS>ai/<BS>d/uid<End><CR>:wq<CR>

0 comments

Created by: Benoit_Tgt

88 active golfers, 294 entries

Leaderboard (lowest score wins):
26
#1 - Walker Boh / walker_boh

12/09/2015 at 11:39AM

26
#2 - n0nick / n0nick

12/09/2015 at 11:45AM

26
#3 - Urtica dioica / udioica

12/09/2015 at 12:33PM

26
#4 - Jon Krause / jkrause314

12/10/2015 at 06:11AM

26
#5 - John Braxler / braxler

12/10/2015 at 04:43PM

26
#6 - Julian Mendoza / JmenD1

12/12/2015 at 10:19PM

26
#7 - Dirty Harry / TateDirty

12/13/2015 at 02:19PM

26
#8 - Smylers / Smylers2

12/15/2015 at 10:43AM

26
#9 - Gosteau Alexandre / eclostene

12/15/2015 at 01:18PM

26
#10 - Jan Path / jan_path

12/17/2015 at 05:51PM

26
#11 - Charlie / wookie_giant

12/20/2015 at 12:44AM

26
#12 - Alexey Belkov / larksvroom

12/20/2015 at 10:57AM

26
#13 - sellerie schnitzel / sellerieschnitz

12/21/2015 at 01:50PM

26
#14 - aanton / aanton

12/25/2015 at 10:48PM

26
#15 - DrHobo / _DrHobo_

01/03/2016 at 08:01PM

26
#16 - Saki Gw / Sakigw

01/04/2016 at 07:39PM

26
#17 - jackliusr / jackliusr

01/08/2016 at 07:28AM

26
#18 - Evgeny`s Kindle / EvgenyKindle

01/08/2016 at 11:06AM

26
#19 - Alan Kang / alankang

01/08/2016 at 02:55PM

26
#20 - Roberto Carraretto / robcarraretto

01/17/2016 at 12:21PM

26
#21 - Aleksey Zhidkov / AlexeyZhidkov

01/19/2016 at 05:56AM

26
#22 - Daniel Suh / 18kehops

02/03/2016 at 05:10AM

26
#23 - Andre Danielsson / DanielssonAndre

02/09/2016 at 07:53PM

26
#24 - John Smith / literacyisgood

02/11/2016 at 06:13PM

26
#25 - Michael Buckley / apolatg

02/13/2016 at 07:56PM

26
#26 - Mathias Andersson / Wraul

02/14/2016 at 09:50AM

26
#27 - ben kavanagh / bkava

02/19/2016 at 02:05PM

26
#28 - royer / RoyerMoyer1

02/23/2016 at 10:37AM

26
#29 - Xiaocan Li / XiaocanLi

02/28/2016 at 08:29PM

26
#30 - Hao Chen / Chen_Hao

03/10/2016 at 06:07PM

26
#31 - Dinesh Bhosale / MrDineshBhosale

04/01/2016 at 09:56AM

26
#32 - E Both / enboth

04/17/2016 at 03:53PM

26
#33 - John Goes / johnwgoes

05/09/2016 at 12:40AM

26
#34 - territorialmale / territorialmale

06/06/2016 at 04:24PM

26
#35 - Ram Tamtam / ramtamtamtam

06/24/2016 at 01:50PM

26
#36 - Will / w_labranche

09/01/2016 at 02:10AM

26
#37 - Stephen Aument / saument

09/04/2016 at 03:36PM

26
#38 - jdupont655 / jdupont655

09/05/2016 at 10:13PM

26
#39 - trx / trxdbg

10/17/2016 at 12:40PM

26
#40 - Rami Hovi / hacker_lawyer

05/24/2017 at 01:13AM

27
#41 - christos christidis / christo52130455

12/11/2015 at 09:58PM

27
#42 - Domingue Justin / _jdomingue

12/13/2015 at 08:16PM

27
#43 - Dimitar Dimitrov / kurkale6ka

03/09/2016 at 03:34PM

28
#44 - brett / brettyukich

12/09/2015 at 08:26PM

28
#45 - Etienne Florent / EtienneFlorent

11/29/2016 at 11:16AM

29
#46 - mnx / mnxx

12/09/2015 at 11:31AM

29
#47 - SundaraRaman / digital_carver

12/13/2015 at 08:21PM

29
#48 - Ralph Canapa / ralphcanapa

12/14/2015 at 04:23PM

29
#49 - retro / tryphopp

01/12/2016 at 05:04AM

29
#50 - Cristian Lupașcu / clupasq

02/08/2016 at 07:39PM

29
#51 - Carlos A Henríquez Q / lagunex

03/13/2016 at 05:10PM

29
#52 - Chenut Ludovic / 7Brwa7

03/31/2016 at 12:06PM

29
#53 - lilach adir / leelaRed

04/04/2016 at 06:12AM

29
#54 - Ben Hill / KaizenSoze70

05/09/2016 at 04:52PM

29
#55 - TweetDreams / TweetMusicians

10/15/2016 at 04:06AM

29
#56 - Michał Dytko / DytkoM

12/23/2016 at 10:57AM

30
#57 - Thomas Lovén / thomasloven

12/09/2015 at 03:49PM

30
#58 - thlix / thlix

01/10/2016 at 10:29AM

30
#59 - Pratap Koritala / pratap_koritala

02/29/2016 at 07:01AM

31
#60 - lorentrogers / lorentrogers

12/09/2015 at 02:04PM

31
#61 - Samuel Masuy / samasuy

12/09/2015 at 09:10PM

31
#62 - h l / lonnez90

12/09/2015 at 10:42PM

31
#63 - Paulo H Baumann / PauloBaumann

12/11/2015 at 03:05PM

31
#64 - M S / b1790037

03/15/2016 at 08:07PM

31
#65 - Peter Brynza / v3_1

08/19/2016 at 08:41PM

32
#66 - Alexandre Ignjatovic / bankair

12/09/2015 at 10:53AM

32
#67 - Bence Béky / bence_beky

12/11/2015 at 12:11AM

32
#68 - Alexander Botticelli / BotticelliAlex

12/19/2015 at 11:09AM

32
#69 - Sebastian Nickel / tumblingwhimsy

12/24/2015 at 06:09PM

32
#70 - andrei / CebotariAndrei

01/02/2016 at 09:59PM

32
#71 - Lindsay Swift / _lindsai_

01/21/2016 at 10:26PM

32
#72 - Durga Swaroop Perla / durgaswaroop

02/03/2016 at 12:50PM

32
#73 - george iv / geowa4

05/16/2016 at 12:28AM

33
#74 - Sean Stout / s183s657

12/09/2015 at 08:05PM

34
#75 - swordgard / swordgardctf

12/10/2015 at 10:36PM

34
#76 - Etienne Tremel / etiennetremel

02/07/2016 at 11:20AM

36
#77 - Oliver Christ / 0liverChrist

07/12/2016 at 10:49PM

37
#78 - twenty2twoss / twenty2twoss

01/05/2016 at 06:31PM

39
#79 - Corne vd Plas / CornePlas

12/14/2015 at 11:46AM

40
#80 - Wilmer Bandres / WilmerBandres

12/11/2015 at 12:32AM

40
#81 - noname / banxjal2

02/05/2016 at 05:03PM

42
#82 - Mikołaj Morzy / MikolajMorzy

12/15/2015 at 04:13PM

48
#83 - coryknapp / coryknapp

12/09/2015 at 05:25PM

48
#84 - Hank Chinaski / uktechman

04/26/2016 at 08:47AM

52
#85 - Christopher Wells / ExcaliburZero_Z

12/19/2015 at 04:59AM

58
#86 - full name / caeken1

02/15/2016 at 11:12PM

64
#87 - Jakob Schöttl / jschoettl

12/20/2015 at 12:43AM

74
#88 - El Achèche ANIS / elacheche

12/10/2015 at 08:38PM