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 60 remaining solutions by signing in and submitting your own entry
#61 Valvin / @_valvin - Score: 24 - 08/02/20 @ 20:41
:%s/{/"{/<CR>:%s/}}/}}"/<CR>ZZ

0 comments


Created by: @__dadav__

61 active golfers, 164 entries

Leaderboard (lowest score wins):
9
#31 - speisz / @speiszc

07/20/2020 at 08:59PM

9
#32 - John Braxler / @braxler

07/21/2020 at 05:37PM

9
#33 - Benjamin Turner / @passionsplay

07/23/2020 at 04:15AM

9
#34 - Jason / @jason_eveleth

07/23/2020 at 06:43AM

9
#35 - Sergey Averkiev / @ExAnimoso

07/24/2020 at 06:43AM

9
#36 - Andy Yang / @yzwdroid

07/24/2020 at 04:20PM

9
#37 - Bitt Faulk / @bittfaulk

07/24/2020 at 06:46PM

9
#38 - Jacob Shomstein / @jshoms

07/25/2020 at 04:32AM

9
#39 - Jeff Cui / @jeffacce

07/27/2020 at 08:54AM

9
#40 - Rustem B. / @_rustemb

07/31/2020 at 12:44AM

9
#41 - merphant / @merphant

07/31/2020 at 08:08PM

9
#42 - TimMcGuire / @mcguire

08/03/2020 at 02:08PM

10
#43 - Derek Schrock / @derekschrock

07/15/2020 at 09:05PM

10
#44 - Yannick / @Yannick88147038

07/16/2020 at 06:25PM

10
#45 - Ryan Brewer / @ryanbrwr

07/17/2020 at 03:44AM

10
#46 - vito / @vito49999722

07/19/2020 at 09:10AM

10
#47 - Anil Narayan / @AnilNarayan2013

07/24/2020 at 04:11AM

10
#48 - Kurtis D. Miller / @phdkurt

07/26/2020 at 06:55PM

10
#49 - Chris Thompson / @ctmusicnz

07/29/2020 at 05:36AM

10
#50 - Steve Frost / @FrostSteveFrost

08/02/2020 at 01:55AM

10
#51 - Terry Vogelsang / @terryvogelsang

08/03/2020 at 04:30PM

11
#52 - dadav 🥀 / @__dadav__

07/15/2020 at 08:02PM

11
#53 - Remy_Clarke / @_Remy_Clarke_

07/16/2020 at 04:35PM

11
#54 - Julien Duc / @jduc_0

07/17/2020 at 08:41AM

11
#55 - dotvimrc / @dotvimrc1

07/20/2020 at 06:28AM

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

07/22/2020 at 02:24AM

11
#57 - drGsus / @drGsus

07/24/2020 at 05:22PM

12
#58 - Miki Tebeka / @tebeka

07/16/2020 at 06:46AM

14
#59 - Andreas Buhr / @andreas_buhr

07/15/2020 at 08:57PM

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

07/19/2020 at 10:17AM