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):
10
#151 - ever0de / @ever0de

06/23/2021 at 04:33AM

10
#152 - Mohammadreza Moradi / @mrmoradi1988

09/06/2021 at 07:32PM

11
#153 - dadav 🥀 / @__dadav__

07/15/2020 at 08:02PM

11
#154 - Remy_Clarke / @_Remy_Clarke_

07/16/2020 at 04:35PM

11
#155 - Julien Duc / @jduc_0

07/17/2020 at 08:41AM

11
#156 - dotvimrc / @dotvimrc1

07/20/2020 at 06:28AM

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

07/22/2020 at 02:24AM

11
#158 - drGsus / @drGsus

07/24/2020 at 05:22PM

11
#159 - GenericHardwareGamer / @GnrikHrdwrGamer

08/05/2020 at 09:00AM

11
#160 - Max Minaev / @max_minaev11

08/05/2020 at 07:05PM

11
#161 - Luis Rodriguez / @luisthecoder

08/20/2020 at 11:37AM

11
#162 - Nathan Hollows / @nathanhollows

08/21/2020 at 03:59AM

11
#163 - knoebber / @knoebber1

08/25/2020 at 07:07PM

11
#164 - lz2ggf / @lz2ggf

08/26/2020 at 07:39PM

11
#165 - Camilo A. Matajira / @CamiloMatajira

09/01/2020 at 07:51PM

11
#166 - Robert Verst / @r_verst

09/02/2020 at 11:13AM

11
#167 - mhb / @mhbvim

09/05/2020 at 05:29AM

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

09/05/2020 at 09:34PM

11
#169 - Ramūnas Musteikis / @RamnasMusteiki1

10/16/2020 at 01:33PM

11
#170 - roy twt / @roytwt1

10/18/2020 at 03:50PM

11
#171 - Nedko Nedkov / @NedkoNedkov6

12/15/2020 at 06:13PM

11
#172 - :wq / @write_quit_22

05/19/2021 at 06:36PM

11
#173 - Tommy / @Tommy75962547

08/24/2021 at 04:55AM

12
#174 - Miki Tebeka / @tebeka

07/16/2020 at 06:46AM

12
#175 - Theo Sarrazin / @tshaero

08/17/2020 at 06:12PM

12
#176 - abhijeet patil / @abhijeetptl5

09/03/2020 at 03:17AM

12
#177 - Christ / @Christ46234422

09/05/2020 at 11:57PM

12
#178 - alrito / @alrito6

09/12/2020 at 10:55PM

12
#179 - Leon Si / @leonzalion

01/29/2021 at 06:24PM

12
#180 - Leander Hendrikx / @leanderhendrikx

09/20/2021 at 12:13PM