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

0 comments


Created by: @__dadav__

160 active golfers, 449 entries

Leaderboard (lowest score wins):
13
#151 - Robin Schütgens / @RobinSchuetgens

08/18/2020 at 06:10PM

13
#152 - Sebastian W. / @Sebasti91439242

09/01/2020 at 11:27PM

13
#153 - Ben Wainwright / @benwainwrightuk

09/26/2020 at 04:04PM

13
#154 - fff / @fff51460170

02/20/2021 at 03:07PM

13
#155 - yu / @mame_shibe

03/04/2021 at 12:02PM

13
#156 - Mihail Orpheus / @mihailorpheuss

03/22/2021 at 07:53AM

14
#157 - Andreas Buhr / @andreas_buhr

07/15/2020 at 08:57PM

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

07/19/2020 at 10:17AM

24
#159 - Valvin / @_valvin

08/02/2020 at 08:41PM

32
#160 - gchain / @gchain7

08/21/2020 at 05:48PM