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 9v00668dd8a80000000002c1

Copy punctuation

I want to copy the last line’s brackets, quotes, and commas to each line. How?

Start file
  #808220    #FF0214    #FFD840    #708230
  #808200    #FF0170    #FFD820    #708210
  #808180    #FF0144    #FFD800    #708190
  #808160    #FF0120    #FFD780    #708170
  #808140    #FF0074    #FFD760    #708150
  #808120    #FF0050    #FFD740    #708130
  #808100    #FF0024    #FFD720    #708110
['#808080', '#FF0000', '#FFD700', '#708090']
End file
['#808220', '#FF0214', '#FFD840', '#708230']
['#808200', '#FF0170', '#FFD820', '#708210']
['#808180', '#FF0144', '#FFD800', '#708190']
['#808160', '#FF0120', '#FFD780', '#708170']
['#808140', '#FF0074', '#FFD760', '#708150']
['#808120', '#FF0050', '#FFD740', '#708130']
['#808100', '#FF0024', '#FFD720', '#708110']
['#808080', '#FF0000', '#FFD700', '#708090']

View Diff

1,7c1,7
<   #808220    #FF0214    #FFD840    #708230
<   #808200    #FF0170    #FFD820    #708210
<   #808180    #FF0144    #FFD800    #708190
<   #808160    #FF0120    #FFD780    #708170
<   #808140    #FF0074    #FFD760    #708150
<   #808120    #FF0050    #FFD740    #708130
<   #808100    #FF0024    #FFD720    #708110
---
> ['#808220', '#FF0214', '#FFD840', '#708230']
> ['#808200', '#FF0170', '#FFD820', '#708210']
> ['#808180', '#FF0144', '#FFD800', '#708190']
> ['#808160', '#FF0120', '#FFD780', '#708170']
> ['#808140', '#FF0074', '#FFD760', '#708150']
> ['#808120', '#FF0050', '#FFD740', '#708130']
> ['#808100', '#FF0024', '#FFD720', '#708110']

Solutions by @mtklar:

Unlock 14 remaining solutions by signing in and submitting your own entry
Created by: @maharba6

124 active golfers, 493 entries

Solutions by @mtklar:
19
#13 - mtklar / @mtklar

10/20/2024 at 09:35AM

22
#>21 - mtklar / @mtklar

10/20/2024 at 09:33AM

23
#>22 - mtklar / @mtklar

10/20/2024 at 09:32AM

25
#>27 - mtklar / @mtklar

10/20/2024 at 09:31AM

28
#>29 - mtklar / @mtklar

10/20/2024 at 09:23AM

30
#>47 - mtklar / @mtklar

10/20/2024 at 09:09AM

32
#>48 - mtklar / @mtklar

10/20/2024 at 09:06AM

33
#>51 - mtklar / @mtklar

10/20/2024 at 09:00AM

33
#>51 - mtklar / @mtklar

10/20/2024 at 09:05AM

35
#>59 - mtklar / @mtklar

10/20/2024 at 08:56AM

35
#>59 - mtklar / @mtklar

10/20/2024 at 08:58AM

36
#>66 - mtklar / @mtklar

10/20/2024 at 08:54AM

56
#>104 - mtklar / @mtklar

10/20/2024 at 08:39AM

64
#>107 - mtklar / @mtklar

10/20/2024 at 08:25AM