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):
8
#31 - A A A / @37fatos

01/11/2021 at 12:08AM

8
#32 - Andreas Siegrist / @andreaszwei

01/28/2021 at 10:05PM

8
#33 - Jianfeng / @Jianfen22425058

02/02/2021 at 08:54AM

8
#34 - Fake Konto / @F4k3K0n70

02/13/2021 at 12:13AM

8
#35 - Tobia Bocchi / @BocchiTobia

02/19/2021 at 12:08PM

8
#36 - yaarrr / @v0lko

03/10/2021 at 12:33PM

8
#37 - der tanzbaer / @der_tanzbaer

03/10/2021 at 04:21PM

8
#38 - maxtong / @maxtong1987

03/19/2021 at 09:46AM

8
#39 - pomélux / @pomelux

03/29/2021 at 07:07PM

8
#40 - Lucas / @Lucas90143719

04/18/2021 at 03:25AM

8
#41 - Jaehong Park / @jaehongp

05/04/2021 at 11:57PM

8
#42 - axnyff / @axnyff

05/11/2021 at 09:06PM

8
#43 - Ray Dennis / @raysden

05/19/2021 at 09:06PM

8
#44 - Michael / @Michael62785035

05/27/2021 at 02:57PM

8
#45 - Arya Kumar / @SusSquirrel

05/27/2021 at 11:03PM

8
#46 - Mihail Orpheus / @mihailorpheuss

05/30/2021 at 10:03PM

8
#47 - vim_maxter / @MaxterVim

07/02/2021 at 10:42AM

8
#48 - AN HA / @quocAnHa

07/26/2021 at 11:09PM

8
#49 - Roman Privalov / @RomanPrivalov

08/23/2021 at 12:37AM

8
#50 - yancy / @yancy_dong

09/17/2021 at 01:54AM

8
#51 - jdfgjhsbd / @bli231957

10/02/2021 at 10:54AM

9
#52 - Roger Stoltz / @rogsto1

07/15/2020 at 11:19PM

9
#53 - Daniel Steinberg / @dstein64

07/16/2020 at 12:08AM

9
#54 - Jon Krause / @jkrause314

07/16/2020 at 03:35AM

9
#55 - Saki Gw / @Sakigw

07/16/2020 at 06:29AM

9
#56 - Robberechts Arne / @ArneRobberechts

07/16/2020 at 10:38AM

9
#57 - Smylers / @Smylers2

07/16/2020 at 04:21PM

9
#58 - analogpixel / @analogp1xel

07/16/2020 at 07:21PM

9
#59 - Виталий Макаров / @avada_keda_bra

07/16/2020 at 09:49PM

9
#60 - garry quested / @GQuested

07/17/2020 at 10:54AM