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):
11
#91 - Julien Duc / @jduc_0

07/17/2020 at 08:41AM

11
#92 - dotvimrc / @dotvimrc1

07/20/2020 at 06:28AM

11
#93 - Ron-Shan,Chang / @highlupin

07/22/2020 at 02:24AM

11
#94 - drGsus / @drGsus

07/24/2020 at 05:22PM

11
#95 - GenericHardwareGamer / @GnrikHrdwrGamer

08/05/2020 at 09:00AM

11
#96 - Max Minaev / @max_minaev11

08/05/2020 at 07:05PM

11
#97 - Luis Rodriguez / @luisthecoder

08/20/2020 at 11:37AM

11
#98 - Nathan Hollows / @nathanhollows

08/21/2020 at 03:59AM

11
#99 - knoebber / @knoebber1

08/25/2020 at 07:07PM

11
#100 - lz2ggf / @lz2ggf

08/26/2020 at 07:39PM

11
#101 - Camilo A. Matajira / @CamiloMatajira

09/01/2020 at 07:51PM

11
#102 - Robert Verst / @r_verst

09/02/2020 at 11:13AM

11
#103 - mhb / @mhbvim

09/05/2020 at 05:29AM

11
#104 - Václav Pernička / @VaclavPernicka

09/05/2020 at 09:34PM

11
#105 - Ramūnas Musteikis / @RamnasMusteiki1

10/16/2020 at 01:33PM

11
#106 - roy twt / @roytwt1

10/18/2020 at 03:50PM

12
#107 - Miki Tebeka / @tebeka

07/16/2020 at 06:46AM

12
#108 - Theo Sarrazin / @tshaero

08/17/2020 at 06:12PM

12
#109 - abhijeet patil / @abhijeetptl5

09/03/2020 at 03:17AM

12
#110 - Christ / @Christ46234422

09/05/2020 at 11:57PM

12
#111 - alrito / @alrito6

09/12/2020 at 10:55PM

13
#112 - Robin Schütgens / @RobinSchuetgens

08/18/2020 at 06:10PM

13
#113 - Sebastian W. / @Sebasti91439242

09/01/2020 at 11:27PM

13
#114 - Ben Wainwright / @benwainwrightuk

09/26/2020 at 04:04PM

14
#115 - Andreas Buhr / @andreas_buhr

07/15/2020 at 08:57PM

22
#116 - सागर पौडेल / @SagarP04d31

07/19/2020 at 10:17AM

24
#117 - Valvin / @_valvin

08/02/2020 at 08:41PM

32
#118 - gchain / @gchain7

08/21/2020 at 05:48PM