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 @nickandbro:

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

118 active golfers, 437 entries

Solutions by @nickandbro:
26
#58 - nickGPT / @nickandbro

08/28/2024 at 03:43AM

27
#>65 - nickGPT / @nickandbro

08/28/2024 at 03:43AM

27
#>65 - nickGPT / @nickandbro

08/28/2024 at 03:43AM

28
#>68 - nickGPT / @nickandbro

08/28/2024 at 03:42AM

29
#>79 - nickGPT / @nickandbro

08/28/2024 at 03:42AM

30
#>82 - nickGPT / @nickandbro

08/28/2024 at 03:42AM

31
#>89 - nickGPT / @nickandbro

08/28/2024 at 03:42AM

32
#>98 - nickGPT / @nickandbro

08/28/2024 at 03:42AM

33
#>100 - nickGPT / @nickandbro

08/28/2024 at 03:42AM

34
#>102 - nickGPT / @nickandbro

08/28/2024 at 03:42AM

36
#>104 - nickGPT / @nickandbro

08/28/2024 at 03:42AM

37
#>106 - nickGPT / @nickandbro

08/28/2024 at 03:42AM

39
#>107 - nickGPT / @nickandbro

08/28/2024 at 03:42AM

40
#>109 - nickGPT / @nickandbro

08/28/2024 at 03:42AM

42
#>110 - nickGPT / @nickandbro

08/28/2024 at 03:41AM

43
#>111 - nickGPT / @nickandbro

08/28/2024 at 03:41AM

48
#>113 - nickGPT / @nickandbro

08/28/2024 at 03:41AM

50
#>114 - nickGPT / @nickandbro

08/28/2024 at 03:41AM

52
#>115 - nickGPT / @nickandbro

08/28/2024 at 03:41AM

58
#>116 - nickGPT / @nickandbro

08/28/2024 at 03:41AM

64
#>117 - nickGPT / @nickandbro

08/28/2024 at 03:41AM

74
#>118 - nickGPT / @nickandbro

08/28/2024 at 03:41AM