Visual Studio Code allows Snippets to perform ✨Variable Transforms✨ using Regex.
Here are some common case transformations that you can apply to your snippets. In these examples, I'm using $TM_FILENAME_BASE
, but the same transformations should apply to any of the Snippet Variables.
snippets-from-delimited.json
can convert filenames like my-file-name
, my_file_name
, my file name
. If your filename is delimited by a dash, underscore, or space, these should work.
snippets-from-mixed-case.json
can convert filenames like myFileName
and MyFileName
. If your filename is in camel
or Pascal
case, these should work.
A snippet to transform Camel Case to Kebab Case