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
#31 - Dinesh Bhosale / @MrDineshBhosale

04/01/2016 at 09:56AM

26
#32 - E Both / @enboth

04/17/2016 at 03:53PM

26
#33 - John Goes / @johnwgoes

05/09/2016 at 12:40AM

26
#34 - territorialmale / @territorialmale

06/06/2016 at 04:24PM

26
#35 - Ram Tamtam / @ramtamtamtam

06/24/2016 at 01:50PM

26
#36 - Will / @obiwan__k3n00bi

09/01/2016 at 02:10AM

26
#37 - Stephen Aument / @saument

09/04/2016 at 03:36PM

26
#38 - jdupont655 / @jdupont655

09/05/2016 at 10:13PM

26
#39 - trx / @trxdbg

10/17/2016 at 12:40PM

26
#40 - Rami Hovi / @hacker_lawyer

05/24/2017 at 01:13AM

26
#41 - 杨洋 / @176795444

07/16/2017 at 09:32AM

26
#42 - Turkey Man / @lvturkeyman

11/22/2017 at 05:47AM

26
#43 - DHM / @DHM29978992

04/30/2018 at 02:22AM

26
#44 - Dax / @zacoxi

12/06/2018 at 06:48AM

26
#45 - alekfed / @alek_fed

04/16/2019 at 05:36PM

26
#46 - majo senf / @majo_senf

06/25/2019 at 09:47AM

26
#47 - Lory / @Lory46845742

12/02/2019 at 10:37AM

26
#48 - Miłosz Łakomy / @foobar01123

01/23/2020 at 05:21AM

26
#49 - RockerZZY / @rocker_zzy

06/23/2020 at 03:14AM

26
#50 - Jung Yeon Park / @park_jungy

02/17/2021 at 12:25AM

26
#51 - A A A / @37fatos

03/13/2021 at 11:12PM

26
#52 - hepebexè / @hepebexe

03/16/2021 at 09:39PM

26
#53 - Jean George / @JeanGeo20504212

02/04/2022 at 09:28PM

26
#54 - Janzen / @__Coos

10/03/2022 at 12:15PM

26
#55 - Berel94 / @Berel94

03/09/2024 at 06:36PM

26
#56 - constap / @constap

05/06/2024 at 11:41AM

26
#57 - Peppa Pig / @PeppaPigSg

07/03/2024 at 01:20AM

26
#58 - nickGPT / @nickandbro

08/28/2024 at 03:43AM

27
#59 - christos christidis / @christo52130455

12/11/2015 at 09:58PM

27
#60 - Domingue Justin / @_jdomingue

12/13/2015 at 08:16PM