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

0 comments


Created by: @__dadav__

118 active golfers, 310 entries

Leaderboard (lowest score wins):
9
#61 - Juan Manuel Fresia / @fresiajm

08/18/2020 at 12:37AM

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

08/18/2020 at 10:59AM

9
#63 - Ilya Komarov ⚛️ / @ilya_komar0ff

08/19/2020 at 12:08AM

9
#64 - serici / @serici

08/20/2020 at 11:06AM

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

08/21/2020 at 01:44AM

9
#66 - RockerZZY / @rocker_zzy

08/24/2020 at 01:04PM

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

08/25/2020 at 02:15PM

9
#68 - 刘宏亮 / @CoyAkey

09/12/2020 at 12:02PM

9
#69 - Ceda EI / @ceda_ei

09/29/2020 at 02:48PM

9
#70 - Brendan Schaenzer / @bschaenzer

10/02/2020 at 01:45AM

9
#71 - mstronam / @mstronam

10/02/2020 at 11:01AM

9
#72 - Gytis Vinclovas / @GytisVinclovas

10/16/2020 at 01:35PM

9
#73 - noam teyssier / @noamteyssier

10/16/2020 at 05:37PM

10
#74 - Derek Schrock / @derekschrock

07/15/2020 at 09:05PM

10
#75 - Yannick / @Yannick88147038

07/16/2020 at 06:25PM

10
#76 - Ryan Brewer / @ryanbrwr

07/17/2020 at 03:44AM

10
#77 - vito / @vito49999722

07/19/2020 at 09:10AM

10
#78 - Anil Narayan / @AnilNarayan2013

07/24/2020 at 04:11AM

10
#79 - Kurtis D. Miller / @phdkurt

07/26/2020 at 06:55PM

10
#80 - Chris Thompson / @ctmusicnz

07/29/2020 at 05:36AM

10
#81 - Steve Frost / @FrostSteveFrost

08/02/2020 at 01:55AM

10
#82 - Terry Vogelsang / @terryvogelsang

08/03/2020 at 04:30PM

10
#83 - Kenny Nguyen / @KennyNg72375669

08/05/2020 at 06:24PM

10
#84 - Martin Bielik / @mabielik

08/06/2020 at 09:20PM

10
#85 - notadevCollins / @NotadevC

08/24/2020 at 01:32AM

10
#86 - Yasky / @Yaasky

09/01/2020 at 04:54PM

10
#87 - Muffin / @Muffin91707986

09/05/2020 at 09:24AM

10
#88 - Arijus / @argshook

10/16/2020 at 01:33PM

11
#89 - dadav 🥀 / @__dadav__

07/15/2020 at 08:02PM

11
#90 - Remy_Clarke / @_Remy_Clarke_

07/16/2020 at 04:35PM