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 165 remaining solutions by signing in and submitting your own entry
#166 gchain / @gchain7 - Score: 32 - 08/21/20 @ 17:48
:%s/\v(.*)(\{\{.*\}\})/\1"\2"<CR>ZZ

0 comments


Created by: @__dadav__

166 active golfers, 487 entries

Leaderboard (lowest score wins):
12
#151 - Miki Tebeka / @tebeka

07/16/2020 at 06:46AM

12
#152 - Theo Sarrazin / @tshaero

08/17/2020 at 06:12PM

12
#153 - abhijeet patil / @abhijeetptl5

09/03/2020 at 03:17AM

12
#154 - Christ / @Christ46234422

09/05/2020 at 11:57PM

12
#155 - alrito / @alrito6

09/12/2020 at 10:55PM

12
#156 - Leon Si / @leonzalion

01/29/2021 at 06:24PM

13
#157 - Robin Schütgens / @RobinSchuetgens

08/18/2020 at 06:10PM

13
#158 - Sebastian W. / @Sebasti91439242

09/01/2020 at 11:27PM

13
#159 - Ben Wainwright / @benwainwrightuk

09/26/2020 at 04:04PM

13
#160 - fff / @fff51460170

02/20/2021 at 03:07PM

13
#161 - yu / @mame_shibe

03/04/2021 at 12:02PM

13
#162 - Mihail Orpheus / @mihailorpheuss

03/22/2021 at 07:53AM

14
#163 - Andreas Buhr / @andreas_buhr

07/15/2020 at 08:57PM

22
#164 - सागर पौडेल / @SagarP04d31

07/19/2020 at 10:17AM

24
#165 - Valvin / @_valvin

08/02/2020 at 08:41PM

32
#166 - gchain / @gchain7

08/21/2020 at 05:48PM