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
#61 - Jonathan / @jonathannerat

07/17/2020 at 02:21PM

9
#62 - Richard Lowe / @b0ggyb33

07/17/2020 at 02:24PM

9
#63 - Leandro Lourenci / @lourenci

07/17/2020 at 05:20PM

9
#64 - Norbert / @mullno

07/17/2020 at 08:13PM

9
#65 - LCY / @Chooneh

07/18/2020 at 06:51AM

9
#66 - matteo / @matteo55169132

07/19/2020 at 06:32PM

9
#67 - Daniel Habib / @danielhvs

07/20/2020 at 04:01AM

9
#68 - speisz / @speiszc

07/20/2020 at 08:59PM

9
#69 - John Braxler / @braxler

07/21/2020 at 05:37PM

9
#70 - Benjamin Turner / @passionsplay

07/23/2020 at 04:15AM

9
#71 - Jason / @jason_eveleth

07/23/2020 at 06:43AM

9
#72 - Sergey Averkiev / @ExAnimoso

07/24/2020 at 06:43AM

9
#73 - Andy Yang / @yzwdroid

07/24/2020 at 04:20PM

9
#74 - Bitt Faulk / @bittfaulk

07/24/2020 at 06:46PM

9
#75 - Jacob Shomstein / @jshoms

07/25/2020 at 04:32AM

9
#76 - Jeff Cui / @jeffacce

07/27/2020 at 08:54AM

9
#77 - Rustem B. / @_rustemb

07/31/2020 at 12:44AM

9
#78 - merphant / @merphant

07/31/2020 at 08:08PM

9
#79 - TimMcGuire / @mcguire

08/03/2020 at 02:08PM

9
#80 - ぼとぼと / @boto_voto

08/05/2020 at 12:29PM

9
#81 - Thiago Becker 😷 / @beckert

08/05/2020 at 02:55PM

9
#82 - Alek Mugnozzo / @mugnozzo

08/08/2020 at 08:56AM

9
#83 - David Martínez / @g0ddrinksjava

08/08/2020 at 06:56PM

9
#84 - Tanzeel Kazi / @tanzeelkazi

08/13/2020 at 09:25AM

9
#85 - Martin Kauppinen / @MartinKauppinen

08/15/2020 at 09:47AM

9
#86 - Juan Manuel Fresia / @fresiajm

08/18/2020 at 12:37AM

9
#87 - Андрей / @appomsk

08/18/2020 at 10:59AM

9
#88 - Ilya Komarov ⚛️ / @ilya_komar0ff

08/19/2020 at 12:08AM

9
#89 - serici / @serici

08/20/2020 at 11:06AM

9
#90 - Łukasz Kadłubowski / @LAKadlubowski

08/21/2020 at 01:44AM