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 315 remaining solutions by signing in and submitting your own entry
#316 Corentin Leriche / @LericheCorentin - Score: 47 - 01/03/23 @ 15:53
<Down><Down><Down><Down><Down><Down><Down><Down><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right>i"<Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right>"<Esc>:wq!<CR>

0 comments


Created by: @__dadav__

316 active golfers, 1007 entries

Leaderboard (lowest score wins):
12
#301 - HYoMo-nim / @HYoMo-nim

04/02/2025 at 02:01PM

13
#302 - Robin Schütgens / @RobinSchuetgens

08/18/2020 at 06:10PM

13
#303 - Sebastian W. / @Sebasti91439242

09/01/2020 at 11:27PM

13
#304 - Ben Wainwright / @benwainwrightuk

09/26/2020 at 04:04PM

13
#305 - fff / @fff51460170

02/20/2021 at 03:07PM

13
#306 - yu / @mame_shibe

03/04/2021 at 12:02PM

13
#307 - Markus Muschol / @MarkusMuschol

07/13/2021 at 08:08PM

13
#308 - ishj00 / @ishj00

04/01/2025 at 01:21PM

14
#309 - Andreas Buhr / @andreas_buhr

07/15/2020 at 08:57PM

17
#310 - kimbadaa / @kimbadaa

04/02/2025 at 12:55PM

18
#311 - yunari11 / @yunari11

03/27/2025 at 01:45AM

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

07/19/2020 at 10:17AM

24
#313 - Valvin / @_valvin

08/02/2020 at 08:41PM

32
#314 - Bro / @SpeorgNot

08/21/2020 at 05:48PM

32
#315 - Joss Sparkes / @JossSparkes

10/28/2021 at 03:35PM

47
#316 - Corentin Leriche / @LericheCorentin

01/03/2023 at 03:53PM