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 5f0f5fbe280fbf000c233304

Add quotes to ansible playbook

You created an ansible playbook, but forgot to add quotes. Can you fix it?

Start file
---
- hosts: all
  vars:
    ssh_state: True
  tasks:
    - name: Manage openssh
      package:
        name: openssh
        state: {{ ssh_state }}
End file
---
- hosts: all
  vars:
    ssh_state: True
  tasks:
    - name: Manage openssh
      package:
        name: openssh
        state: "{{ ssh_state }}"

View Diff

9c9
<         state: {{ ssh_state }}
---
>         state: "{{ ssh_state }}"

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 gchain / @gchain7 - Score: 32 - 08/21/20 @ 17:48
:%s/\v(.*)(\{\{.*\}\})/\1"\2"<CR>ZZ

0 comments


Created by: @__dadav__

118 active golfers, 310 entries

Leaderboard (lowest score wins):
9
#31 - Robberechts Arne / @ArneRobberechts

07/16/2020 at 10:38AM

9
#32 - Smylers / @Smylers2

07/16/2020 at 04:21PM

9
#33 - analogpixel / @analogp1xel

07/16/2020 at 07:21PM

9
#34 - Виталий Макаров / @avada_keda_bra

07/16/2020 at 09:49PM

9
#35 - garry quested / @GQuested

07/17/2020 at 10:54AM

9
#36 - Jonathan / @jonathannerat

07/17/2020 at 02:21PM

9
#37 - Richard Lowe / @b0ggyb33

07/17/2020 at 02:24PM

9
#38 - Leandro Lourenci / @lourenci

07/17/2020 at 05:20PM

9
#39 - Norbert / @mullno

07/17/2020 at 08:13PM

9
#40 - LCY / @Chooneh

07/18/2020 at 06:51AM

9
#41 - matteo / @matteo55169132

07/19/2020 at 06:32PM

9
#42 - Daniel Habib / @danielhvs

07/20/2020 at 04:01AM

9
#43 - speisz / @speiszc

07/20/2020 at 08:59PM

9
#44 - John Braxler / @braxler

07/21/2020 at 05:37PM

9
#45 - Benjamin Turner / @passionsplay

07/23/2020 at 04:15AM

9
#46 - Jason / @jason_eveleth

07/23/2020 at 06:43AM

9
#47 - Sergey Averkiev / @ExAnimoso

07/24/2020 at 06:43AM

9
#48 - Andy Yang / @yzwdroid

07/24/2020 at 04:20PM

9
#49 - Bitt Faulk / @bittfaulk

07/24/2020 at 06:46PM

9
#50 - Jacob Shomstein / @jshoms

07/25/2020 at 04:32AM

9
#51 - Jeff Cui / @jeffacce

07/27/2020 at 08:54AM

9
#52 - Rustem B. / @_rustemb

07/31/2020 at 12:44AM

9
#53 - merphant / @merphant

07/31/2020 at 08:08PM

9
#54 - TimMcGuire / @mcguire

08/03/2020 at 02:08PM

9
#55 - ぼとぼと / @boto_voto

08/05/2020 at 12:29PM

9
#56 - Thiago Becker / @beckert

08/05/2020 at 02:55PM

9
#57 - Alek Mugnozzo / @mugnozzo

08/08/2020 at 08:56AM

9
#58 - David Martínez / @g0ddrinksjava

08/08/2020 at 06:56PM

9
#59 - Tanzeel Kazi / @tanzeelkazi

08/13/2020 at 09:25AM

9
#60 - Martin Kauppinen / @MartinKauppinen

08/15/2020 at 09:47AM