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 108 remaining solutions by signing in and submitting your own entry
#109 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

109 active golfers, 390 entries

Leaderboard (lowest score wins):
28
#61 - Ivo Blöchliger / @aigledesalpes

08/23/2019 at 08:45PM

29
#62 - mnx / @mnxx

12/09/2015 at 11:31AM

29
#63 - SundaraRaman / @digital_carver

12/13/2015 at 08:21PM

29
#64 - Ralph Canapa / @ralphcanapa

12/14/2015 at 04:23PM

29
#65 - retro / @tryphopp

01/12/2016 at 05:04AM

29
#66 - Cristian Lupașcu / @clupasq

02/08/2016 at 07:39PM

29
#67 - Carlos A HenrĂ­quez Q / @lagunex

03/13/2016 at 05:10PM

29
#68 - Chenut Ludovic / @7Brwa7

03/31/2016 at 12:06PM

29
#69 - lilach adir / @leelaRed

04/04/2016 at 06:12AM

29
#70 - Ben Hill / @KaizenSoze70

05/09/2016 at 04:52PM

29
#71 - TweetDreams / @TweetMusicians

10/15/2016 at 04:06AM

29
#72 - Michał Dytko / @DytkoM

12/23/2016 at 10:57AM

30
#73 - Thomas Lovén / @thomasloven

12/09/2015 at 03:49PM

30
#74 - thlix / @thlix

01/10/2016 at 10:29AM

30
#75 - Pratap Koritala / @pratap_koritala

02/29/2016 at 07:01AM

31
#76 - lorentrogers / @lorentrogers

12/09/2015 at 02:04PM

31
#77 - Samuel Masuy / @samasuy

12/09/2015 at 09:10PM

31
#78 - Holden Lewis / @lonnez90

12/09/2015 at 10:42PM

31
#79 - Paulo H Baumann / @PauloBaumann

12/11/2015 at 03:05PM

31
#80 - M S / @b1790037

03/15/2016 at 08:07PM

31
#81 - Peter Brynza / @v3_1

08/19/2016 at 08:41PM

31
#82 - Gurukandhamoorthi / @Gurukandhamoor1

07/13/2017 at 10:12AM

32
#83 - Alexandre Ignjatovic / @bankair

12/09/2015 at 10:53AM

32
#84 - Bence BĂ©ky / @bence_beky

12/11/2015 at 12:11AM

32
#85 - Alexander Botticelli / @BotticelliAlex

12/19/2015 at 11:09AM

32
#86 - Sebastian Nickel / @tumblingwhimsy

12/24/2015 at 06:09PM

32
#87 - andrei / @CebotariAndrei

01/02/2016 at 09:59PM

32
#88 - Lindsay Swift / @_lindsai_

01/21/2016 at 10:26PM

32
#89 - Durga Swaroop Perla / @durgaswaroop

02/03/2016 at 12:50PM

32
#90 - george iv / @geowa4

05/16/2016 at 12:28AM