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
#91 - RockerZZY / @rocker_zzy

08/24/2020 at 01:04PM

9
#92 - fenn.stefan@gmail.com / @FennStefan

08/25/2020 at 02:15PM

9
#93 - 刘宏亮 / @CoyAkey

09/12/2020 at 12:02PM

9
#94 - Ceda EI / @ceda_ei

09/29/2020 at 02:48PM

9
#95 - Brendan Schaenzer / @bschaenzer

10/02/2020 at 01:45AM

9
#96 - mstronam / @mstronam

10/02/2020 at 11:01AM

9
#97 - Gytis Vinclovas / @GytisVinclovas

10/16/2020 at 01:35PM

9
#98 - noam teyssier / @noamteyssier

10/16/2020 at 05:37PM

9
#99 - Leland Paul Kusmer / @lelandpaul

10/23/2020 at 02:21PM

9
#100 - moh ayaya / @AyayaMoh

11/07/2020 at 09:27PM

9
#101 - hepebexè / @hepebexe

11/30/2020 at 10:09PM

9
#102 - chocolate / @chocola81394123

12/03/2020 at 03:06AM

9
#103 - Björn Struckmeier / @BjrnStruckmeie1

01/07/2021 at 01:38PM

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

01/21/2021 at 09:12AM

9
#105 - 영훈 / @odjfnrtm

02/14/2021 at 03:48AM

9
#106 - ArtemisZX / @ArtemisCZX

02/14/2021 at 09:17AM

9
#107 - 김범준 / @kmbmjn

02/17/2021 at 01:33AM

9
#108 - SwordSwordSwordBird / @SwordSwordBird

02/21/2021 at 06:30AM

9
#109 - hamb / @hamb88140219

02/21/2021 at 08:49AM

9
#110 - b0wman / @b0wman_x00

02/27/2021 at 02:00PM

9
#111 - Trong Kha Nguyen / @__ngtrongkha

03/01/2021 at 09:43AM

9
#112 - Paul Adlene / @AdlenePaul

03/15/2021 at 09:40AM

9
#113 - pikjes / @pikjes2

03/20/2021 at 06:14PM

9
#114 - Jackmarocks / @jackmarocks

03/23/2021 at 06:24PM

9
#115 - Baptiste Nicolet / @b_nicolet

04/06/2021 at 03:37PM

9
#116 - Russell Helmstedter / @RHelmstedter

04/07/2021 at 05:40PM

9
#117 - Michele Gargiulo / @michele_gargi

04/15/2021 at 04:31PM

9
#118 - Kenneth Hyman / @kjhyman

04/27/2021 at 02:57PM

9
#119 - Tim Varley / @varleti

04/27/2021 at 08:35PM

9
#120 - m397 / @m39752809546

05/11/2021 at 10:45AM