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
#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

18
#17 - martin tourneboeuf / @martintournebo1

06/01/2017 at 06:22PM

18
#18 - Dmitry Teslenko / @krab_mozga

06/27/2017 at 07:56AM

18
#19 - Matti Sairanen / @MattiSairanen

08/03/2017 at 01:46PM

18
#20 - Gurukandhamoorthi / @Gurukandhamoor1

08/11/2017 at 03:34PM

18
#21 - Bradley M. Small / @BradleySmall

11/23/2017 at 02:52AM

18
#22 - Turkey Man / @lvturkeyman

12/02/2017 at 03:51AM

18
#23 - Bitt Faulk / @bittfaulk

03/09/2020 at 04:53PM

18
#24 - Jon Krause / @jkrause314

12/21/2020 at 05:41PM

18
#25 - pikjes / @pikjes2

07/16/2021 at 11:39AM

18
#26 - Alex / @AlexanderHeatl2

07/07/2022 at 06:36PM

18
#27 - Janzen / @__Coos

10/04/2022 at 11:15AM

18
#28 - キムラ・OPEL・ユウジ / @kimurayuuji79

11/07/2022 at 12:19AM

18
#29 - ._. / @Katharsic

11/21/2022 at 02:35PM

18
#30 - Olivier Bégassat / @zk_evm

06/12/2023 at 11:55PM