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

0 comments


Created by: @__dadav__

190 active golfers, 597 entries

Leaderboard (lowest score wins):
9
#121 - Antoine Hachez / @Antoine_Hachez

05/17/2021 at 07:38AM

9
#122 - zmf_tim / @zmf_tim

05/31/2021 at 08:17PM

9
#123 - Michel Viktor / @tomkpz

07/25/2021 at 03:54AM

9
#124 - panakin skywalker / @_j3ffrey

08/31/2021 at 04:46PM

9
#125 - Hossein Yousefi 💙 / @u_hossein

09/06/2021 at 07:34PM

9
#126 - yu xie / @yuxie21997666

09/15/2021 at 12:21PM

9
#127 - vineet / @vineet38383726

09/16/2021 at 10:30AM

9
#128 - Nick Repetti / @nick_repetti

09/23/2021 at 07:54PM

9
#129 - Mi60 Dev / @mi60dev

10/10/2021 at 02:41PM

9
#130 - Shunichi Kanade / @shunkana

10/11/2021 at 02:42AM

10
#131 - Derek Schrock / @derekschrock

07/15/2020 at 09:05PM

10
#132 - Yannick / @Yannick88147038

07/16/2020 at 06:25PM

10
#133 - Ryan Brewer / @ryanbrwr

07/17/2020 at 03:44AM

10
#134 - vito / @vito49999722

07/19/2020 at 09:10AM

10
#135 - Anil Narayan / @AnilNarayan2013

07/24/2020 at 04:11AM

10
#136 - Kurtis D. Miller / @phdkurt

07/26/2020 at 06:55PM

10
#137 - Chris Thompson / @ctmusicnz

07/29/2020 at 05:36AM

10
#138 - Steve Frost / @FrostSteveFrost

08/02/2020 at 01:55AM

10
#139 - Terry Vogelsang / @terryvogelsang

08/03/2020 at 04:30PM

10
#140 - Kenny Nguyen / @KennyNg72375669

08/05/2020 at 06:24PM

10
#141 - Martin Bielik / @mabielik

08/06/2020 at 09:20PM

10
#142 - notadevCollins / @NotadevC

08/24/2020 at 01:32AM

10
#143 - Yasky / @Yaasky

09/01/2020 at 04:54PM

10
#144 - Muffin / @Muffin91707986

09/05/2020 at 09:24AM

10
#145 - Arijus / @argshook

10/16/2020 at 01:33PM

10
#146 - John Doe / @JohnDoe75830353

12/24/2020 at 02:01PM

10
#147 - Pranshu Goyal / @PranshuGoyal

02/13/2021 at 09:07AM

10
#148 - Sergio Semedi / @SergioSemedi

04/11/2021 at 05:43PM

10
#149 - Daniel Qu / @danielq9871

05/03/2021 at 01:51PM

10
#150 - Joe Farnsworth / @JoeFarnsworth

06/22/2021 at 02:06AM