Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

vscode custom snippets multiple transform

"${TM_FILENAME_BASE/([A-Z])/${1:+-}${1:/downcase}/g}"
/*
To break this down, I start by grabbing the file name, then I
get a capital letter using the regular expression [A-Z] and
capture it in a group by putting parentheses around it,
then I access that group using ${1:} and add a dash before it
using +-, then I access that group again and make the capital
letter lowercase using /downcase, finally I put /g at the end
to make sure this gets applied to all of the capital letters.
*/
 
PREVIOUS NEXT
Tagged: #vscode #custom #snippets #multiple #transform
ADD COMMENT
Topic
Name
9+5 =