If you want to restore these on another machine, you'd just copy the code-backup directory's contents over and reverse the process shown above (that is, untar the config files into VS Code config directory and run the ext script) Wrapping up In your code-backup folder, you should have your config files in a tar archive and your extension install script as ext. Alternatively, you could push these into a Git repo. The config files are saved in JSON format, so to back these up, you would simply tar them and save them somewhere in the cloud. Now we also need to export the configuration files. You can output these into a file like this: mkdir /home/$USER/code-backup & cd /home/$USER/code-backupĬode - list-extensions | xargs -L 1 echo code -install-extension > ext The output of this command looks like this: code -install-extension anseki.vscode-colorĬode -install-extension autsenc.laravel-blade-spacerĬode -install-extension Dart-Code.flutterĪs you see we've successfully transformed the extension names to installation commands via xargs. The code -list-extensions command exports the list of installed VS Code extensions which we then pipe into xargs, this transforms each extension's name into an extension install command. Our basic command for exporting the list of extensions is going to look like this: code - list-extensions | xargs -L 1 echo code -install-extension We'll be using the old trusty Linux terminal magic and VS Code's command line utility code. Setting up the backupįor this article, I'm going to suppose that you have VS Code already installed on your system and want to backup the settings and extensions you've spent some of your precious time setting up. What I'm going to show you this time around is a simple script that can help with the task of backing up your Visual Studio Code settings and extensions for use on your secondary PC, virtual environment or even your computer at work. This might be a case for your system configuration files (dotfiles) and your development tools alike. Having the same working environment across multiple machines is always a good thing.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |