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 5e4dfcccaa2db400090b66c3

prepend * to every non-blank line

Prepend an asterisk to every non-blank line in the input file.

Start file
This is a
very short

file, but it is 
still
full

of

surpises.
End file
*This is a
*very short

*file, but it is 
*still
*full

*of

*surpises.

View Diff

1,2c1,2
< This is a
< very short
---
> *This is a
> *very short
4,6c4,6
< file, but it is 
< still
< full
---
> *file, but it is 
> *still
> *full
8c8
< of
---
> *of
10c10
< surpises.
---
> *surpises.

Solutions by @HaipengLie:

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

1514 active golfers, 6202 entries

Solutions by @HaipengLie:
10
#256 - haipeng li / @HaipengLie

08/08/2020 at 01:37PM

11
#>606 - haipeng li / @HaipengLie

08/08/2020 at 01:34PM

12
#>775 - haipeng li / @HaipengLie

08/08/2020 at 01:34PM

14
#>843 - haipeng li / @HaipengLie

05/04/2020 at 01:58AM

14
#>861 - haipeng li / @HaipengLie

08/08/2020 at 01:32PM

16
#>1005 - haipeng li / @HaipengLie

05/04/2020 at 01:53AM

17
#>1091 - haipeng li / @HaipengLie

05/03/2020 at 12:48PM

18
#>1142 - haipeng li / @HaipengLie

05/04/2020 at 01:57AM

19
#>1185 - haipeng li / @HaipengLie

05/03/2020 at 12:32PM

19
#>1185 - haipeng li / @HaipengLie

05/03/2020 at 12:44PM

21
#>1304 - haipeng li / @HaipengLie

05/03/2020 at 12:32PM

22
#>1348 - haipeng li / @HaipengLie

05/03/2020 at 12:21PM

22
#>1348 - haipeng li / @HaipengLie

05/03/2020 at 12:31PM

26
#>1442 - haipeng li / @HaipengLie

05/03/2020 at 12:19PM