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):
9
#91 - hepebexè / @hepebexe

11/30/2020 at 10:09PM

9
#92 - chocolate / @chocola81394123

12/03/2020 at 03:06AM

9
#93 - Björn Struckmeier / @BjrnStruckmeie1

01/07/2021 at 01:38PM

9
#94 - Ray Dennis / @raysden

01/08/2021 at 08:27PM

9
#95 - 蔡徐坤真是爱吃屎 / @Hashub7

01/21/2021 at 09:12AM

9
#96 - 영훈 / @odjfnrtm

02/14/2021 at 03:48AM

9
#97 - ArtemisZX / @ArtemisCZX

02/14/2021 at 09:17AM

9
#98 - 김범준 / @kmbmjn

02/17/2021 at 01:33AM

9
#99 - SwordSwordSwordBird / @SwordSwordBird

02/21/2021 at 06:30AM

9
#100 - hamb / @hamb88140219

02/21/2021 at 08:49AM

9
#101 - b0wman / @b0wman_x00

02/27/2021 at 02:00PM

9
#102 - Trong Kha Nguyen / @__ngtrongkha

03/01/2021 at 09:43AM

9
#103 - Paul Adlene / @AdlenePaul

03/15/2021 at 09:40AM

9
#104 - pikjes / @pikjes2

03/20/2021 at 06:14PM

9
#105 - Jackmarocks / @jackmarocks

03/23/2021 at 06:24PM

9
#106 - Baptiste Nicolet / @b_nicolet

04/06/2021 at 03:37PM

9
#107 - Russell Helmstedter / @RHelmstedter

04/07/2021 at 05:40PM

9
#108 - Michele Gargiulo / @michele_gargi

04/15/2021 at 04:31PM

9
#109 - Kenneth Hyman / @kjhyman

04/27/2021 at 02:57PM

9
#110 - Tim Varley / @varleti

04/27/2021 at 08:35PM

10
#111 - Derek Schrock / @derekschrock

07/15/2020 at 09:05PM

10
#112 - Yannick / @Yannick88147038

07/16/2020 at 06:25PM

10
#113 - Ryan Brewer / @ryanbrwr

07/17/2020 at 03:44AM

10
#114 - vito / @vito49999722

07/19/2020 at 09:10AM

10
#115 - Anil Narayan / @AnilNarayan2013

07/24/2020 at 04:11AM

10
#116 - Kurtis D. Miller / @phdkurt

07/26/2020 at 06:55PM

10
#117 - Chris Thompson / @ctmusicnz

07/29/2020 at 05:36AM

10
#118 - Steve Frost / @FrostSteveFrost

08/02/2020 at 01:55AM

10
#119 - Terry Vogelsang / @terryvogelsang

08/03/2020 at 04:30PM

10
#120 - Kenny Nguyen / @KennyNg72375669

08/05/2020 at 06:24PM