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

118 active golfers, 437 entries

Leaderboard (lowest score wins):
32
#91 - Bence Béky / @bence_beky

12/11/2015 at 12:11AM

32
#92 - Alexander Botticelli / @BotticelliAlex

12/19/2015 at 11:09AM

32
#93 - Sebastian Nickel / @tumblingwhimsy

12/24/2015 at 06:09PM

32
#94 - andrei / @CebotariAndrei

01/02/2016 at 09:59PM

32
#95 - Lindsay Swift / @_lindsai_

01/21/2016 at 10:26PM

32
#96 - Durga Swaroop Perla / @durgaswaroop

02/03/2016 at 12:50PM

32
#97 - george iv / @geowa4

05/16/2016 at 12:28AM

32
#98 - Jonas Sunde V / @sunde_v

08/04/2017 at 05:35PM

33
#99 - Sean Stout / @s183s657

12/09/2015 at 08:05PM

33
#100 - Bhatta Sushmith / @bsushmith

08/25/2017 at 01:06PM

34
#101 - swordgard / @swordgardctf

12/10/2015 at 10:36PM

34
#102 - Etienne Tremel / @etiennetremel

02/07/2016 at 11:20AM

36
#103 - Oliver Christ / @0liverChrist

07/12/2016 at 10:49PM

36
#104 - James / @Dronak

11/07/2022 at 05:02PM

37
#105 - twenty2twoss / @twenty2twoss

01/05/2016 at 06:31PM

37
#106 - Sxcy / @SxcyX

11/06/2018 at 03:40PM

39
#107 - Corne vd Plas / @CornePlas

12/14/2015 at 11:46AM

40
#108 - Wilmer Bandres / @WilmerBandres

12/11/2015 at 12:32AM

40
#109 - noname / @banxjal2

02/05/2016 at 05:03PM

42
#110 - Mikołaj Morzy / @MikolajMorzy

12/15/2015 at 04:13PM

43
#111 - anonymouse / @anonymo65837183

04/21/2022 at 11:46PM

48
#112 - Cory Knapp / @coryknapp

12/09/2015 at 05:25PM

48
#113 - Hank Chinaski / @uktechman

04/26/2016 at 08:47AM

50
#114 - Jurica / @Jurica34581259

11/19/2018 at 09:35PM

52
#115 - Christopher Wells / @ExcaliburZero_Z

12/19/2015 at 04:59AM

58
#116 - full name / @caeken1

02/15/2016 at 11:12PM

64
#117 - Jakob Schöttl / @jschoettl

12/20/2015 at 12:43AM

74
#118 - El Achèche ANIS 🇹🇳 / @elacheche

12/10/2015 at 08:38PM