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 130 remaining solutions by signing in and submitting your own entry
#131 gchain / @gchain7 - Score: 32 - 08/21/20 @ 17:48
:%s/\v(.*)(\{\{.*\}\})/\1"\2"<CR>ZZ

0 comments


Created by: @__dadav__

131 active golfers, 341 entries

Leaderboard (lowest score wins):
9
#61 - Thiago Becker / @beckert

08/05/2020 at 02:55PM

9
#62 - Alek Mugnozzo / @mugnozzo

08/08/2020 at 08:56AM

9
#63 - David Martínez / @g0ddrinksjava

08/08/2020 at 06:56PM

9
#64 - Tanzeel Kazi / @tanzeelkazi

08/13/2020 at 09:25AM

9
#65 - Martin Kauppinen / @MartinKauppinen

08/15/2020 at 09:47AM

9
#66 - Juan Manuel Fresia / @fresiajm

08/18/2020 at 12:37AM

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

08/18/2020 at 10:59AM

9
#68 - Ilya Komarov ⚛️ / @ilya_komar0ff

08/19/2020 at 12:08AM

9
#69 - serici / @serici

08/20/2020 at 11:06AM

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

08/21/2020 at 01:44AM

9
#71 - RockerZZY / @rocker_zzy

08/24/2020 at 01:04PM

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

08/25/2020 at 02:15PM

9
#73 - 刘宏亮 / @CoyAkey

09/12/2020 at 12:02PM

9
#74 - Ceda EI / @ceda_ei

09/29/2020 at 02:48PM

9
#75 - Brendan Schaenzer / @bschaenzer

10/02/2020 at 01:45AM

9
#76 - mstronam / @mstronam

10/02/2020 at 11:01AM

9
#77 - Gytis Vinclovas / @GytisVinclovas

10/16/2020 at 01:35PM

9
#78 - noam teyssier / @noamteyssier

10/16/2020 at 05:37PM

9
#79 - Leland Paul Kusmer / @lelandpaul

10/23/2020 at 02:21PM

9
#80 - moh ayaya / @AyayaMoh

11/07/2020 at 09:27PM

9
#81 - hepebexè / @hepebexe

11/30/2020 at 10:09PM

9
#82 - chocolate / @chocola81394123

12/03/2020 at 03:06AM

9
#83 - Björn Struckmeier / @BjrnStruckmeie1

01/07/2021 at 01:38PM

9
#84 - Ray Dennis / @raysden

01/08/2021 at 08:27PM

10
#85 - Derek Schrock / @derekschrock

07/15/2020 at 09:05PM

10
#86 - Yannick / @Yannick88147038

07/16/2020 at 06:25PM

10
#87 - Ryan Brewer / @ryanbrwr

07/17/2020 at 03:44AM

10
#88 - vito / @vito49999722

07/19/2020 at 09:10AM

10
#89 - Anil Narayan / @AnilNarayan2013

07/24/2020 at 04:11AM

10
#90 - Kurtis D. Miller / @phdkurt

07/26/2020 at 06:55PM