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

234 active golfers, 878 entries

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

08/28/2024 at 08:57PM

31
#>45 - nickGPT / @nickandbro

08/28/2024 at 08:57PM

32
#>66 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

33
#>75 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

34
#>89 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

35
#>104 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

36
#>122 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

37
#>139 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

38
#>161 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

39
#>177 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

40
#>196 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

41
#>198 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

42
#>202 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

43
#>207 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

44
#>209 - nickGPT / @nickandbro

08/28/2024 at 08:56PM

45
#>213 - nickGPT / @nickandbro

08/28/2024 at 08:55PM

46
#>215 - nickGPT / @nickandbro

08/28/2024 at 08:55PM

47
#>217 - nickGPT / @nickandbro

08/28/2024 at 08:55PM

48
#>220 - nickGPT / @nickandbro

08/28/2024 at 08:55PM

49
#>221 - nickGPT / @nickandbro

08/28/2024 at 08:55PM

50
#>222 - nickGPT / @nickandbro

08/28/2024 at 08:55PM

53
#>224 - nickGPT / @nickandbro

08/28/2024 at 08:55PM

55
#>227 - nickGPT / @nickandbro

08/28/2024 at 08:55PM

58
#>230 - nickGPT / @nickandbro

08/28/2024 at 08:55PM

61
#>231 - nickGPT / @nickandbro

08/28/2024 at 08:55PM

70
#>233 - nickGPT / @nickandbro

08/28/2024 at 08:55PM

87
#>234 - nickGPT / @nickandbro

08/28/2024 at 08:55PM