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):
26
#1 - Walker Boh / @walker_boh

12/09/2015 at 11:39AM

26
#2 - n0nick / @n0nick

12/09/2015 at 11:45AM

26
#3 - Urtica dioica / @udioica

12/09/2015 at 12:33PM

26
#4 - Jon Krause / @jkrause314

12/10/2015 at 06:11AM

26
#5 - John Braxler / @braxler

12/10/2015 at 04:43PM

26
#6 - Julian Mendoza / @JmenD1

12/12/2015 at 10:19PM

26
#7 - Dirty Harry / @TateDirty

12/13/2015 at 02:19PM

26
#8 - Smylers / @Smylers2

12/15/2015 at 10:43AM

26
#9 - Gosteau Alexandre / @eclostene

12/15/2015 at 01:18PM

26
#10 - Jan Path / @jan_path

12/17/2015 at 05:51PM

26
#11 - Charlie / @wookie_giant

12/20/2015 at 12:44AM

26
#12 - Alexey Belkov / @larksvroom

12/20/2015 at 10:57AM

26
#13 - sellerie schnitzel / @sellerieschnitz

12/21/2015 at 01:50PM

26
#14 - aanton / @aanton

12/25/2015 at 10:48PM

26
#15 - DrHobo / @_DrHobo_

01/03/2016 at 08:01PM

26
#16 - Saki Gw / @Sakigw

01/04/2016 at 07:39PM

26
#17 - jackliusr / @jackliusr

01/08/2016 at 07:28AM

26
#18 - Evgeny`s Kindle / @EvgenyKindle

01/08/2016 at 11:06AM

26
#19 - Alan Kang / @alankang

01/08/2016 at 02:55PM

26
#20 - Roberto Carraretto / @robcarraretto

01/17/2016 at 12:21PM

26
#21 - Aleksey Zhidkov / @AlexeyZhidkov

01/19/2016 at 05:56AM

26
#22 - Daniel Suh / @18kehops

02/03/2016 at 05:10AM

26
#23 - Andre Danielsson / @DanielssonAndre

02/09/2016 at 07:53PM

26
#24 - John Smith / @literacyisgood

02/11/2016 at 06:13PM

26
#25 - Michael Buckley / @apolatg

02/13/2016 at 07:56PM

26
#26 - Mathias Andersson / @Wraul

02/14/2016 at 09:50AM

26
#27 - ben kavanagh / @bkava

02/19/2016 at 02:05PM

26
#28 - royer / @RoyerMoyer1

02/23/2016 at 10:37AM

26
#29 - Xiaocan Li / @XiaocanLi

02/28/2016 at 08:29PM

26
#30 - Hao Chen / @Chen_Hao

03/10/2016 at 06:07PM