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):
32
#91 - Jonas Sunde V / @sunde_v

08/04/2017 at 05:35PM

33
#92 - Sean Stout / @s183s657

12/09/2015 at 08:05PM

33
#93 - Bhatta Sushmith / @bsushmith

08/25/2017 at 01:06PM

34
#94 - swordgard / @swordgardctf

12/10/2015 at 10:36PM

34
#95 - Etienne Tremel / @etiennetremel

02/07/2016 at 11:20AM

36
#96 - Oliver Christ / @0liverChrist

07/12/2016 at 10:49PM

37
#97 - twenty2twoss / @twenty2twoss

01/05/2016 at 06:31PM

37
#98 - Sxcy / @SxcyX

11/06/2018 at 03:40PM

39
#99 - Corne vd Plas / @CornePlas

12/14/2015 at 11:46AM

40
#100 - Wilmer Bandres / @WilmerBandres

12/11/2015 at 12:32AM

40
#101 - noname / @banxjal2

02/05/2016 at 05:03PM

42
#102 - Mikołaj Morzy / @MikolajMorzy

12/15/2015 at 04:13PM

48
#103 - Cory Knapp / @coryknapp

12/09/2015 at 05:25PM

48
#104 - Hank Chinaski / @uktechman

04/26/2016 at 08:47AM

50
#105 - Jurica / @Jurica34581259

11/19/2018 at 09:35PM

52
#106 - Christopher Wells / @ExcaliburZero_Z

12/19/2015 at 04:59AM

58
#107 - full name / @caeken1

02/15/2016 at 11:12PM

64
#108 - Jakob Schöttl / @jschoettl

12/20/2015 at 12:43AM

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

12/10/2015 at 08:38PM