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 by @Smylers2:

Unlock 8 remaining solutions by signing in and submitting your own entry
Created by: @Benoit_Tgt

109 active golfers, 390 entries

Solutions by @Smylers2:
26
#8 - Smylers / @Smylers2

12/15/2015 at 10:43AM

27
#>52 - Smylers / @Smylers2

12/09/2015 at 11:41AM

28
#>58 - Smylers / @Smylers2

12/09/2015 at 11:39AM

29
#>61 - Smylers / @Smylers2

12/09/2015 at 10:51AM

29
#>62 - Smylers / @Smylers2

12/09/2015 at 11:32AM

30
#>72 - Smylers / @Smylers2

12/09/2015 at 10:50AM

31
#>75 - Smylers / @Smylers2

12/09/2015 at 11:31AM

32
#>82 - Smylers / @Smylers2

12/09/2015 at 10:43AM