Skip to content

Instantly share code, notes, and snippets.

@lktslionel
Last active April 24, 2023 01:42
Show Gist options
  • Save lktslionel/84343c5b69728f4439d4bb75c9295ccc to your computer and use it in GitHub Desktop.
Save lktslionel/84343c5b69728f4439d4bb75c9295ccc to your computer and use it in GitHub Desktop.
VSCode Profiles • Getting Started

VSCode Profiles

1. Overview

You can know create profile from within VSCode. This allows you to manage separate components for different contexts. You will be able to group those components in regards of the context on where they are used. You can imagine a set of different profile if you want to work as a cloud Engineer, Frontend Software Engineer, Default, Rust Developer, for demos, and so on.

2. Components

  • Settings

    • settings.json
  • Keyboard Shortcuts

    • keybindings.json
  • Snippets

  • UI State

    • globalState.json
  • Extensions

    The live in

    Windows %USERPROFILE%\.vscode\extensions
    macOS ~/.vscode/extensions
    Linux ~/.vscode/extensions
    

3. References

3.1. Location

3.1.1. User Directory

Everything related to users in VSCode is stored within the VSCODE_USERDIR

# Windows
VSCODE_USERDIR="%APPDATA%\Code\User"

# Lunix
VSCODE_USERDIR="$HOME/.config/Code/User"

# macOS
VSCODE_USERDIR="$HOME/Library/Application\ Support/Code/User"

That's the overview of the content of this directory

├── globalStorage
│   ├── alefragnani.project-manager
│   ├── amazonwebservices.aws-toolkit-vscode
│   │   ├── cloudformation.schema.json
│   │   ├── logs
│   │   ├── sam.schema.json
│   │   └── telemetryCache
│   ├── fwcd.kotlin
│   ├── github.vscode-pull-request-github
│   │   └── temp
│   ├── mhutchie.git-graph
│   │   ├── avatars
│   │   └── life-cycle.json
│   ├── ms-dotnettools.dotnet-interactive-vscode
│   ├── ms-toolsai.jupyter
│   │   ├── nbsecret
│   │   └── nbsignatures
│   ├── ms-vscode-remote.remote-containers
│   │   └── cli-bin
│   ├── ms-vscode.powershell
│   │   ├── logs
│   │   └── sessions
│   ├── ms-vsliveshare.vsliveshare
│   │   ├── dotnet-3.0.0
│   │   ├── dotnet-3.1.1
│   │   └── dotnet-3.1.14
│   ├── redhat.vscode-xml
│   ├── redhat.vscode-yaml
│   │   └── schemas_cache
│   ├── state.vscdb
│   ├── state.vscdb.backup
│   ├── storage.json
│   ├── thomaskarachristos.terminal-statusbar
│   │   └── sideBarActions.json
│   ├── vscode-redhat-telemetry
│   │   └── cache
│   └── vscode.json-language-features
│       └── json-schema-cache
├── keybindings.json
├── settings.json
├── profiles
├── snippets
│   └── markdown.json
└── sync

.vscode store the workspace settings of vscode. It is located in the root of your project. For multi-root project, see [.code-workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces)

.vscode/
├── extensions.json
├── launch.json
├── settings.json
├── tasks.json
├── jsconfig.json
├── snippets/
│   ├── javascript.json
│   ├── my-snippets-1.code-snippets
│   ├── my-snippets-2.code-snippets
│   └── my-snippets-3.code-snippets
└── keybindings.json

3.1.2. Profiles

Profiles are stored within:

  • Windows: ${Env:VSCODE_USERDIR}\profiles
  • macOS: ${VSCODE_USERDIR}/profiles
  • Linux: ${VSCODE_USERDIR}/profiles

Example:

# vscode-remote-conainers
$HOME/.vscode-server/data/User/profiles/23d1e380
└── extensions.json

3.2. Managing profiles

You can:

  • Create profiles

  • Switch profiles

  • Delete profiles

  • Share profiles

  • Import/Export profiles contents

  • Launch VSCode with a specific profile

    $> code ~/projects/web-sample --profile "Web Development"

3.3. Temporary Profile

A Temporary Profile is a profile that is not saved across VS Code sessions. You create a Temporary Profile via the Profiles: Create a Temporary Profile command in the Command Palette. The Temporary Profile starts as an Empty Profile and has an automatically generated name (such as Temp 1). You can modify the profile settings and extensions, use the profile for the lifetime of your VS Code session, but it will be deleted once you close VS Code. Temporary Profiles are useful if you want to try a new configuration or test an extension without modifying your default or existing profile. Restarting VS Code reenables the current profile for your workspace.

4. Apendix

4.1. Resources

4.2. Sample

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment