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

0 comments


Created by: @__dadav__

106 active golfers, 278 entries

Leaderboard (lowest score wins):
8
#1 - Tinko Minko / @tandikula

07/17/2020 at 09:41PM

8
#2 - せいほう / @FICSQF

07/18/2020 at 01:58AM

8
#3 - JL T / @l0f4r0

07/19/2020 at 05:45PM

8
#4 - PK / @pkeugine

07/20/2020 at 03:10AM

8
#5 - Saurabh / @Saurabh09299

07/21/2020 at 09:08AM

8
#6 - Mislav Vuletić / @MasterGeeMedo

07/25/2020 at 06:57AM

8
#7 - Kim Bäckström / @Norttiiii

07/25/2020 at 09:26AM

8
#8 - Petro Тrouq / @zulolosi

07/26/2020 at 06:49PM

8
#9 - MathijsHoogland / @MathijsHoogland

07/27/2020 at 07:20AM

8
#10 - Gergely Risko / @errge

07/28/2020 at 10:07PM

8
#11 - Olle Wiklund / @Kabix

08/01/2020 at 06:07AM

8
#12 - Miłosz Łakomy / @foobar01123

08/02/2020 at 10:18AM

8
#13 - Ángel Durán / @AngeeelD

08/02/2020 at 05:39PM

8
#14 - Filipe Brandenburger / @filbranden

08/03/2020 at 04:22PM

8
#15 - Vinay Sharma / @VinaySh63956554

08/08/2020 at 06:08PM

8
#16 - Ivan Kwong / @IvanKwong5

08/09/2020 at 02:32PM

8
#17 - Ravi S Sinha / @ambidextrousTx

08/10/2020 at 10:55PM

8
#18 - Nicolas Marier / @NicMarier

08/13/2020 at 12:52PM

8
#19 - Cao Van Bi / @CaoVanBi235

08/21/2020 at 01:22AM

8
#20 - Blake Tereau / @BlakeTereau

08/26/2020 at 09:53PM

8
#21 - Luc Kien Hang / @luckienhang

09/04/2020 at 12:25AM

8
#22 - akouryy / @akouryy1

09/05/2020 at 02:00PM

8
#23 - dezhonger / @dezhonger

09/05/2020 at 04:04PM

9
#24 - Roger Stoltz / @rogsto1

07/15/2020 at 11:19PM

9
#25 - Daniel Steinberg / @dstein64

07/16/2020 at 12:08AM

9
#26 - Jon Krause / @jkrause314

07/16/2020 at 03:35AM

9
#27 - Saki Gw / @Sakigw

07/16/2020 at 06:29AM

9
#28 - Robberechts Arne / @ArneRobberechts

07/16/2020 at 10:38AM

9
#29 - Smylers / @Smylers2

07/16/2020 at 04:21PM

9
#30 - analogpixel / @analogp1xel

07/16/2020 at 07:21PM