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

0 comments


Created by: @__dadav__

164 active golfers, 467 entries

Leaderboard (lowest score wins):
10
#121 - Martin Bielik / @mabielik

08/06/2020 at 09:20PM

10
#122 - notadevCollins / @NotadevC

08/24/2020 at 01:32AM

10
#123 - Yasky / @Yaasky

09/01/2020 at 04:54PM

10
#124 - Muffin / @Muffin91707986

09/05/2020 at 09:24AM

10
#125 - Arijus / @argshook

10/16/2020 at 01:33PM

10
#126 - John Doe / @JohnDoe75830353

12/24/2020 at 02:01PM

10
#127 - Pranshu Goyal / @PranshuGoyal

02/13/2021 at 09:07AM

10
#128 - Sergio Semedi / @SergioSemedi

04/11/2021 at 05:43PM

10
#129 - Daniel Qu / @danielq9871

05/03/2021 at 01:51PM

11
#130 - dadav 🥀 / @__dadav__

07/15/2020 at 08:02PM

11
#131 - Remy_Clarke / @_Remy_Clarke_

07/16/2020 at 04:35PM

11
#132 - Julien Duc / @jduc_0

07/17/2020 at 08:41AM

11
#133 - dotvimrc / @dotvimrc1

07/20/2020 at 06:28AM

11
#134 - Ron-Shan,Chang / @highlupin

07/22/2020 at 02:24AM

11
#135 - drGsus / @drGsus

07/24/2020 at 05:22PM

11
#136 - GenericHardwareGamer / @GnrikHrdwrGamer

08/05/2020 at 09:00AM

11
#137 - Max Minaev / @max_minaev11

08/05/2020 at 07:05PM

11
#138 - Luis Rodriguez / @luisthecoder

08/20/2020 at 11:37AM

11
#139 - Nathan Hollows / @nathanhollows

08/21/2020 at 03:59AM

11
#140 - knoebber / @knoebber1

08/25/2020 at 07:07PM

11
#141 - lz2ggf / @lz2ggf

08/26/2020 at 07:39PM

11
#142 - Camilo A. Matajira / @CamiloMatajira

09/01/2020 at 07:51PM

11
#143 - Robert Verst / @r_verst

09/02/2020 at 11:13AM

11
#144 - mhb / @mhbvim

09/05/2020 at 05:29AM

11
#145 - Václav Pernička / @VaclavPernicka

09/05/2020 at 09:34PM

11
#146 - Ramūnas Musteikis / @RamnasMusteiki1

10/16/2020 at 01:33PM

11
#147 - roy twt / @roytwt1

10/18/2020 at 03:50PM

11
#148 - Nedko Nedkov / @NedkoNedkov6

12/15/2020 at 06:13PM

12
#149 - Miki Tebeka / @tebeka

07/16/2020 at 06:46AM

12
#150 - Theo Sarrazin / @tshaero

08/17/2020 at 06:12PM