This post piggybacks off of the work done by @avanslaars who is a fellow instructor at egghead.io. He shared this in the egghead Slack sometime ago...
For further actions, you may consider blocking this person and/or reporting abuse
Nice trick Joe, I created an extension this week to do just that! Profile Switcher allows you to save a bunch of profiles and swap between them from within vscode 😁
Woah! Spooky timing - I'll have to check it out and share it with the team at egghead - I'm glad you found my post 😄
Really 👻!
I was preparing to write a blog about it today on here as well 🤣
Would love to hear what you all think of it and look to collaborate and make it better for everyone.
And here is the post!
Thanks for sharing this but I messed it up. Was just trying to see how this works quickly — to answer a question on Twitter and the command
code --user-data-dir
is potentially destructive. I opened on my desktop and now there are a whole bunch of files there as well as that the article mentions nothing about going back and what was the default user directory?My normal VSCode setup is all broken now. Looks like that VSCode is still using Desktop as the user directory instead of whatever was the normal default and I have no idea what was that.
Truly lost here. :(
Kindly, mention in your article that the command is potentially destructive.
OK. So, it looks like you have to open VSCode with a simple
code
command for it to reset the user directory — where ever it is set to default since the docs certainly don't mention anything about what is the default here.Hi Ahmad! Sorry to hear about the trouble you had 😢
But it sounds like you were able to figure it out? Is there anything you'd like me to add to the post to better clarify using this method as an
alias
vs using the regularcode
command?What is the benefit of this approach over workspaces? This seems like manual work when a VSCode workspace can be saved with per-workspace settings, extensions, etc. You simply re-open the workspace and pick up where you left off.
Yes, that's true. But based on my understanding, aren't workspaces tied to your repository in the
.vscode/
directory?So the advantage to this approach is you can launch any project by using this command, without having to manually change the workspace settings.
You can use "Save Workspace As" and save it anywhere you would like. Then open the .code-workspace file to open it from anywhere.
Oh, now I see what you're saying. Save it somewhere and then with each project, you load the workspace. So it's never tied to a repository. Smart!
Never really explained what a Code Profile is.
Just different versions of applied settings?
Sorry, Henry. I will add a definition at the top! But yes, it's just a different settings configuration.
Word, thanks! :)
Thanks for helping me improve the post! 🙏🏼
Do the profiles allow for enabling different language extensions such that one can have a Python or PHP or Document Editing profile?
Yes! I didn't cover that in this article but if you take a look at Andy's repo, you can see how he does it:
github.com/avanslaars/code-profiles
I'm starting to record screencasts and this is going to make it 10x easier, thank you!!
Just what I looking for @jsjoeio , thanks!!!