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 4fa0d2fa2037000001000057

Exchanging Quotes

Sometimes you need to exchange a choice of quotes in some code.

Start file
mystring = 'This quoted string contains \' and is also'
           'surrounded with \' characters.  It is also'
           'a multiline string too'
End file
mystring = "This quoted string contains ' and used to be"
           "surrounded with ' characters.  It is also"
           "a multiline string too"

View Diff

1,3c1,3
< mystring = 'This quoted string contains \' and is also'
<            'surrounded with \' characters.  It is also'
<            'a multiline string too'
---
> mystring = "This quoted string contains ' and used to be"
>            "surrounded with ' characters.  It is also"
>            "a multiline string too"

Solutions by @jeffreymrussell:

Unlock 10 remaining solutions by signing in and submitting your own entry
Created by: @jlozinski

228 active golfers, 851 entries

Solutions by @jeffreymrussell:
30
#14 - jeffreymrussell / @jeffreymrussell

03/12/2024 at 12:06PM

31
#>44 - jeffreymrussell / @jeffreymrussell

03/12/2024 at 12:04PM

32
#>65 - jeffreymrussell / @jeffreymrussell

03/12/2024 at 12:03PM

32
#>65 - jeffreymrussell / @jeffreymrussell

03/12/2024 at 12:03PM

32
#>65 - jeffreymrussell / @jeffreymrussell

03/12/2024 at 12:05PM

33
#>74 - jeffreymrussell / @jeffreymrussell

03/12/2024 at 12:02PM

34
#>88 - jeffreymrussell / @jeffreymrussell

03/12/2024 at 12:01PM

35
#>102 - jeffreymrussell / @jeffreymrussell

03/12/2024 at 12:00PM

36
#>120 - jeffreymrussell / @jeffreymrussell

03/12/2024 at 11:59AM

39
#>173 - jeffreymrussell / @jeffreymrussell

03/12/2024 at 11:55AM