A VS Code extensions manifest (#snippet)

Today I read a post about Matthias Ott’s VS Code setup. I love these posts because you can always discover new things.
After I finished reading it, it tweeted it and shared that you can also handle your VSCode extension setup via yo…

Today I read a post about Matthias Ott's VS Code setup. I love these posts because you can always discover new things.

After I finished reading it, it tweeted it and shared that you can also handle your VSCode extension setup via your terminal.

code --install-extension extensionAuthor.extensionName

So far, I've been maintaining a script in my dotfiles to manage my extensions. Meaning, whenever I added a new extension, I had to update this script manually. @shdli answered me with a way nicer approach. He called it a "manifest'y approach". 😆

# backing up VS Code extensions
code --list-extensions > "./visual-studio-code-extensions.txt"

# installing VS Code extensions
cat  "./visual-studio-code-extensions.txt" | xargs -L 1 code --install-extension

Using code --list-extensions I can install my extensions via VS Code and then generate the extension listing which will be re-used to install them. That's very sweet!

This new approach immediately led to me introducing commands like install and backup in my dotfiles. 🙈


Reply to Stefan
Print Share Comment Cite Upload Translate
CITATION GOES HERE CITATION GOES HERE
Select a language: