I'm currently working on a project where I frequently switch between YAML config files that use snake_case and JavaScript, which uses camelCase. Manually converting values between these formats is getting tedious. I'm wondering if there's a VSCode shortcut or extension that can streamline this process, like a simple copy and convert feature. Any tips or recommendations? Thanks!
4 Answers
Check out this extension: [Change Case](https://marketplace.visualstudio.com/items?itemName=akopachov.change-case-ex). It adds options to the context menu for all sorts of casing conversions. You can even use regex and add cursors for mass editing. It makes the whole thing a breeze!
I usually just find a tool online for that. There's plenty of ad-free sites like 100.st that let you copy, paste, and convert with just a click. It saves you the hassle of typing everything out manually, which is super helpful!
Why not just write a small function for this? The underscore in snake_case is a pretty easy separator to work with for splitting and converting it to camelCase. But hey, I get that there are quicker methods too!
You’re a programmer, right? Why not just code a quick solution for it? Could be a fun little project!
Absolutely! Those tools are great. Just copy, click a button, and you're good to go. Much easier than converting manually, especially from db_host to DB_HOST.