Skip to content

Instantly share code, notes, and snippets.

@markwhitfeld
Last active November 23, 2023 16:27
Show Gist options
  • Save markwhitfeld/53aa259706860110958ab10a8e1c403c to your computer and use it in GitHub Desktop.
Save markwhitfeld/53aa259706860110958ab10a8e1c403c to your computer and use it in GitHub Desktop.
VsCode Snippet for converting Camel/Pascal Case to kebab-case
{
"Camel as Kebab": {
"prefix": "x-kebab",
"body": [
"${1} -> ${1/([a-z]*)(([A-Z])+([a-z]+))?/${1:/downcase}${2:+-}${3:/downcase}${4:/downcase}/g}"
],
"description": "dash separators"
},
"lowerFirstLetter": {
"prefix": "x-lower-first",
"body": [
"${1} -> ${1/(^\\S)(.*)/${1:/downcase}${2}/g}"
],
"description": "lower first letter"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment