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 587e0a9d5944680006000007

Turn a ninja to case-insensitive [Nn][Ii][Nn][Jj][Aa] regexp!

I bumped into this in a dailywtf code: http://pastebin.com/QApa5ycS I didn't want to translate a string whenever I wanted to be [Ss][Aa][Rr][Cc][Aa][Ss][Tt][Ii][Cc] on slack, so I figured a script (python, sed, whatever) would be helpful. Well, or a few vim keystroke!

Start file
SarCastic
End file
[Ss][Aa][Rr][Cc][Aa][Ss][Tt][Ii][Cc]

View Diff

1c1
< SarCastic
---
> [Ss][Aa][Rr][Cc][Aa][Ss][Tt][Ii][Cc]

Solutions

The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!

Check out these helpful resources to improve your Vim skills... Game on.

Unlock 37 remaining solutions by signing in and submitting your own entry
#38 we’re going to need a bigger bot / @assaflavie - Score: 20 - 01/24/17 @ 22:40
:s/./[\u\0\l\0]/g<CR>ZZ

0 comments


#39 e_e / @eleloi - Score: 20 - 02/20/23 @ 23:33
:s/./[\u\0\l\0]/g<CR>ZZ

0 comments


Created by: @kmarc

39 active golfers, 67 entries

Leaderboard (lowest score wins):
18
#31 - moh ayaya / @AyayaMoh

09/27/2023 at 03:32PM

18
#32 - Luoyb / @Luoyb

11/17/2023 at 05:50AM

18
#33 - jonas-grobe / @jonas-grobe

02/03/2024 at 09:02PM

18
#34 - Peppa Pig / @PeppaPigSg

07/02/2024 at 09:48AM

18
#35 - nickGPT / @nickandbro

08/28/2024 at 02:57AM

19
#36 - Sergio / @voyeg3r

01/17/2017 at 08:14PM

19
#37 - Michel Viktor / @tomkpz

07/27/2021 at 05:31AM

20
#38 - we’re going to need a bigger bot / @assaflavie

01/24/2017 at 10:40PM

20
#39 - e_e / @eleloi

02/20/2023 at 11:33PM