Lower cased and dashed strings
As I have to generate big fixtures files, I wanted to find a way to format input data the way described by start and end files. Especially the lower-cased-and-dashed ids Not so good to find a pure Vim way, that's why I submit this challenge ;)
Start file
Lôrem Ipsum
Dolor.eros
Auctor: eros (elémentum)
Tincïdunt, âc
End file
lorem-ipsum:
name: "Lôrem Ipsum"
dolor-eros:
name: "Dolor.eros"
auctor-eros-elementum:
name: "Auctor: eros (elémentum)"
tincidunt-ac:
name: "Tincïdunt, âc"
View Diff
1,4c1,8
< Lôrem Ipsum
< Dolor.eros
< Auctor: eros (elémentum)
< Tincïdunt, âc
---
> lorem-ipsum:
> name: "Lôrem Ipsum"
> dolor-eros:
> name: "Dolor.eros"
> auctor-eros-elementum:
> name: "Auctor: eros (elémentum)"
> tincidunt-ac:
> name: "Tincïdunt, âc"
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 18 remaining solutions by signing in and submitting your own entry
#19 Walker Boh / @walker_boh - Score: 107 - 10/05/15 @ 11:35
:se enc=utf-8<CR>qqy$A:<CR> name: ""<Esc>P+q3@qkhhraTcrikkllx%x%TlreF(xgglroqqVgu:s/[ /<BS>\t.<BS><BS>.]/=<BS>-/g<CR>jjq3@qkf,xZZ
0 comments
#20 nickGPT / @nickandbro - Score: 107 - 08/28/24 @ 03:53
:se enc=utf-8<CR>qqy$A:<CR> name: ""<Esc>P+q3@qkhhraTcrikkllx%x%TlreF(xgglroqqVgu:s/[ /<BS>\t.<BS><BS>.]/=<BS>-/g<CR>jjq3@qkf,xZZ
0 comments