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 14 remaining solutions by signing in and submitting your own entry
#15 Roberto Carraretto / robcarraretto - Score: 18 - 03/15/17 @ 01:18
:s/./[\U&\L&]/g<CR>ZZ

0 comments

#16 Evgeny`s Kindle / EvgenyKindle - Score: 18 - 03/19/17 @ 09:42
:s/./[\U&\L&]/g<CR>ZZ

0 comments

#17 Sergio / voyeg3r - Score: 19 - 01/17/17 @ 20:14
:s,.,[\U&\L&],g<CR>:x<CR>

0 comments

#18 Assaf Lavie / AssafLavie - Score: 20 - 01/24/17 @ 22:40
:s/./[\u\0\l\0]/g<CR>ZZ

0 comments

Created by: kmARC

18 active golfers, 30 entries

Leaderboard (lowest score wins):
18
#1 - Smylers / Smylers2

01/17/2017 at 12:20PM

18
#2 - Urtica dioica / udioica

01/17/2017 at 12:30PM

18
#3 - Sebastian Korten / FlashKorten

01/17/2017 at 12:50PM

18
#4 - Saki Gw / Sakigw

01/17/2017 at 01:05PM

18
#5 - Anoop Kumar / anooplive

01/17/2017 at 01:14PM

18
#6 - Stanislav / prstad

01/17/2017 at 03:06PM

18
#7 - John Braxler / braxler

01/17/2017 at 03:49PM

18
#8 - Fernando Dias / fdiasdev

01/17/2017 at 05:22PM

18
#9 - Valacar / valacar

01/18/2017 at 04:26AM

18
#10 - Abc Def / phweiss1

01/18/2017 at 09:07AM

18
#11 - sijinyuan / sijinyuan

01/22/2017 at 02:20AM

18
#12 - Benedikt Ames / wisp3rwind

01/29/2017 at 06:57PM

18
#13 - Alexandre Jasmin / ajasmin

02/19/2017 at 06:42PM

18
#14 - Zhihong Liu / pieapple03

03/03/2017 at 03:38PM

18
#15 - Roberto Carraretto / robcarraretto

03/15/2017 at 01:18AM

18
#16 - Evgeny`s Kindle / EvgenyKindle

03/19/2017 at 09:42AM

19
#17 - Sergio / voyeg3r

01/17/2017 at 08:14PM

20
#18 - Assaf Lavie / AssafLavie

01/24/2017 at 10:40PM