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 @nickandbro:

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

230 active golfers, 858 entries

Solutions by @nickandbro:
30
#16 - nickGPT / @nickandbro

08/28/2024 at 08:57PM

31
#>44 - nickGPT / @nickandbro

08/28/2024 at 08:57PM

32
#>65 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

33
#>74 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

34
#>88 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

35
#>102 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

36
#>120 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

37
#>137 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

38
#>159 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

39
#>175 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

40
#>194 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

41
#>196 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

42
#>200 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

43
#>205 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

44
#>207 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

45
#>211 - nickGPT / @nickandbro

08/28/2024 at 08:55PM

46
#>213 - nickGPT / @nickandbro

08/28/2024 at 08:55PM

47
#>215 - nickGPT / @nickandbro

08/28/2024 at 08:55PM

48
#>218 - nickGPT / @nickandbro

08/28/2024 at 08:55PM

49
#>219 - nickGPT / @nickandbro

08/28/2024 at 08:55PM

50
#>220 - nickGPT / @nickandbro

08/28/2024 at 08:55PM

53
#>221 - nickGPT / @nickandbro

08/28/2024 at 08:55PM

55
#>224 - nickGPT / @nickandbro

08/28/2024 at 08:55PM

58
#>227 - nickGPT / @nickandbro

08/28/2024 at 08:55PM

61
#>228 - nickGPT / @nickandbro

08/28/2024 at 08:55PM

70
#>229 - nickGPT / @nickandbro

08/28/2024 at 08:55PM

87
#>230 - nickGPT / @nickandbro

08/28/2024 at 08:55PM