Skip to content

Instantly share code, notes, and snippets.

@nandordudas
Last active September 21, 2024 08:52
Show Gist options
  • Save nandordudas/a80971a3cf4a4563a26bc9aa3cfc8c00 to your computer and use it in GitHub Desktop.
Save nandordudas/a80971a3cf4a4563a26bc9aa3cfc8c00 to your computer and use it in GitHub Desktop.
Setup WSL 2 on Windows 11

Install Scoop: A Command-Line Installer for Windows

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
iex "& {$(irm get.scoop.sh)} -ScoopDir ${Env:USERPROFILE}/Scoop"
scoop install git
scoop bucket add extras

Scoop is a command-line installer for Windows that makes it easy to install and manage software.

To install PowerShell and other utilities:

winget upgrade --all --silent --include-unknown
winget install Microsoft.PowerShell
winget install Microsoft.PowerToys
Font settings

Recommended font: Maple Mono

scoop bucket add nerd-fonts
scoop install Maple-Mono Maple-Mono-NF
Customize Powershell

Install Starship to customize your PowerShell prompt.

scoop install starship
Invoke-Expression (& starship init powershell) # Add the following to the end of your PowerShell configuration

Update your PowerShell profile:

winget install Microsoft.VisualStudioCode
code $PROFILE

Add your profile content and save the file.

To update Windows Terminal settings:

  • Set it as the default profile
  • Disable the logo by adding -NoLogo after the command (/pwsh.exe -NoLogo)
  • Set the font face to Maple Mono NF under Settings/Defaults/Font face

To install Docker Desktop and Visual Studio Code:

winget install Docker.DockerDesktop
winget install Microsoft.VisualStudioCode

Note

If using Docker Desktop is not feasible, you can set up Docker with WSL instead:

# Ensure WSL is installed
sudo apt update --yes && sudo apt upgrade --yes
mkdir -p ~/Downloads
curl -fsSL https://get.docker.com -o ~/Downloads/get-docker.sh
sudo sh ~/Downloads/get-docker.sh
sudo usermod -aG docker $USER
sudo apt autoremove --yes
rm ~/Downloads/get-docker.sh
# If there are issues with Docker setup, consider deleting the ~/.docker folder both on the host and within WSL

Install Windows Subsystem for Linux (WSL)

Open Windows Terminal with Administrator Permissions

Set up the new user. The following commands are run in PowerShell, not in WSL:

# Set up Ubuntu within WSL or choose a specific release, such as Ubuntu-24.04
wsl --install --distribution Ubuntu-24.04
Restart-Computer
# After reboot, rerun the installation command if needed
wsl --install --distribution Ubuntu-24.04
wsl --update
wsl --user root apt update --yes
wsl --user root apt upgrade --yes
# Check system info
wsl lsb_release --all
# Set the default distribution
wsl --list
wsl --set-default Ubuntu-24.04

Optional: Upgrade WSL

#  Prepare WSL image for upgrade
sudo apt install update-manager-core
# Upgrade WSL image; use the "-d, --devel-release" flag for development versions
sudo do-release-upgrade
sudo apt update --yes && sudo apt upgrade --yes
sudo apt install --yes zsh
sudo apt autoremove --yes

Export Your WSL (Recommended)

It's recommended to export your WSL image to an external disk for backup and space-saving purposes:

wsl --shutdown
# Export WSL image to an external disk
mkdir E:/WSL
wsl --export Ubuntu-24.04 "E:/WSL/Ubuntu-24.04.tar"
wsl --unregister Ubuntu-24.04
wsl --import Ubuntu-24.04 "E:/WSL/Ubuntu-24.04" "E:/WSL/Ubuntu-24.04.tar"
wsl --set-default Ubuntu-24.04

Tip

Add WSL configuration on the host.

Check wslconfig. Restart WSL:

wsl --shutdown

Install Recommended VS Code Extensions

Install extensions for remote development:

code --install-extension ms-vscode-remote.remote-wsl

Set Up Git in WSL

Note

You don't need to set up Git on the host, but it's recommended to set the email and name globally.

Use Windows Terminal, VS Code, or WSL Bash.

Git config: Check out Delta and exiftool.

Check Delta and ExifTool.

# On WSL Ubuntu
base_url=https://github.com/dandavison/delta/releases
delta_version=$(curl -s "https://api.github.com/repos/dandavison/delta/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')
filename="git-delta_${delta_version}_amd64.deb"
# Download and install Delta
curl -fsSL "${base_url}/download/${delta_version}/${filename}" -o "$HOME/Downloads/$filename"
sudo dpkg --install "$HOME/Downloads/git-delta_${delta_version}_amd64.deb"
sudo apt install --yes exiftool
rm "$HOME/Downloads/$filename"
Setup Zsh

Oh-My-Zsh helps in customizing your shell.

sudo apt install --yes zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
curl -sS https://starship.rs/install.sh | sh

Advanced Git Setup

Configure Git for Multiple Repositories

Use local repositories in the following structure:

# Set up includeIf for GitHub repos
git config --global --add includeIf.gitdir:"$HOME/Code/GitHub/**/.git".path "$HOME/Code/GitHub/.gitconfig"
# Configure GitHub-specific fetch refspec
git config --file="$HOME/Code/GitHub/.gitconfig" --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pull_requests/*"
# Optionally remove conflicting settings from specific repositories
# Navigate to the repository and run:
git config --file=.git/config --unset remote.origin.fetch
# Verify your configurations to ensure that the correct settings are applied
git config --list --show-origin
~/Code
  ├── GitHub
  │   ├── .gitconfig
  │   ├── john_doe
  │   │   ├── acme
  │   │   │   └── .git
  │   │   ├── ...
  │   ... ...
  ├── GitLab
  │   ├── .gitconfig
  │   ├── jane_doe
  │   │   ├── foo
  │   │   │   └── .git
  │   │   ├── ...
  ... ... ...

Configure refspecs for different repositories (GitLab, GitHub, Bitbucket).

# Set up includeIf for GitLab repos
git config --global --add includeIf.gitdir:"$HOME/Code/GitLab/**/.git".path "$HOME/Code/GitLab/.gitconfig"
# Set up includeIf for Bitbucket repos
git config --global --add includeIf.gitdir:"$HOME/Code/Bitbucket/**/.git".path "$HOME/Code/Bitbucket/.gitconfig"
# Configure GitLab-specific fetch refspec
git config --file="$HOME/Code/GitLab/.gitconfig" --add remote.origin.fetch "+refs/merge-requests/*/head:refs/remotes/origin/merge_requests/*"
# Configure Bitbucket-specific fetch refspec
git config --file="$HOME/Code/BitBucket/.gitconfig" --add remote.origin.fetch "+refs/pull-requests/*/from:refs/remotes/origin/pull_requests/*"
# Optionally remove conflicting settings from specific repositories
# Navigate to the repository and run:
git config --file=.git/config --unset remote.origin.fetch
# Verify your configurations to ensure that the correct settings are applied
git config --list --show-origin

Note

If you have issues with signing commits with a GPG key, check GPG for Win, sharing GPG keys.

GPG for Win, sharing GPG keys and about commit signature verification

To install GPG and configure it:

scoop install sudo
sudo scoop install gpg4win
logoff

After logging back into WSL, you should be all set.

#!/usr/bin/env bash
set -o nounset
set -o errexit
set -o pipefail
IFS=$'\n\t'
CONFIG_FILE="$HOME/.gitconfig"
declare -A cache
backup_config() {
if [[ -e "$CONFIG_FILE" ]]; then
mv "${CONFIG_FILE}" "${CONFIG_FILE}-$(date +%F_%T).bak"
fi
}
exists() {
command -v "$1" >/dev/null 2>&1
}
confirm() {
local title="$1"
local answer
while true; do
read -rp "$title (Y/n): " answer
case ${answer,,} in
y|yes|'') return 0 ;;
n|no) return 1 ;;
*) echo "Invalid input. Please enter 'Y' or 'N'." ;;
esac
done
}
get_secret_keys() {
local email="$1"
if [[ -n "${cache[$email]:-}" ]]; then
echo "${cache[$email]}"
return
fi
local result
result=$(gpg --list-secret-keys "$email" 2>/dev/null | sed -n '2s/.*\(.\{16\}\)$/\1/p')
cache["$email"]=$result
echo "$result"
}
setup_user_info() {
local email="$1"
local name="$2"
git config --global user.email "$email"
git config --global user.name "$name"
git config --global user.useConfigOnly true
}
setup_core_config() {
git config --global advice.detachedHead false
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then
git config --global core.autocrlf true
else
git config --global core.autocrlf input
fi
git config --global core.abbrev 12
git config --global core.fsmonitor true
git config --global core.quotePath false
git config --global core.untrackedCache true
git config --global core.whitespace "fix,-indent-with-non-tab,trailing-space,cr-at-eol"
}
setup_branch_config() {
if confirm "Do you prefer rebasing instead of merging?"; then
git config --global branch.autoSetupRebase always
git config --global pull.rebase merges
git config --global --add --bool rebase.updateRefs true
else
git config --global branch.autoSetupRebase never
git config --global pull.rebase false
fi
}
setup_color_config() {
git config --global color.pager true
git config --global color.ui true
git config --global color.branch.current "yellow reverse"
git config --global color.branch.local yellow
git config --global color.branch.remote green
git config --global color.branch.commit "227 bold"
git config --global color.branch.frag "magenta bold"
git config --global color.branch.meta 227
git config --global color.branch.new "green bold"
git config --global color.branch.old "red bold 52"
git config --global color.branch.whitespace "red reverse"
git config --global color.diff-highlight.newHighlight "green bold 22"
git config --global color.diff-highlight.newNormal "green bold"
git config --global color.diff-highlight.oldHighlight "red bold 52"
git config --global color.diff-highlight.oldNormal "red bold"
git config --global color.status.added yellow
git config --global color.status.changed green
git config --global color.status.untracked cyan
}
setup_delta() {
if exists "delta" && exists "exiftool"; then
git config --global core.pager delta
git config --global delta.commit-decoration-style "bold yellow box ul"
git config --global delta.file-style "bold yellow ul"
git config --global delta.hunk-header-decoration-style "yellow box"
git config --global delta.line-numbers true
git config --global delta.minus-color "#340001"
git config --global delta.plus-color "#012800"
git config --global delta.side-by-side true
git config --global delta.whitespace-error-style "22 reverse"
git config --global diff.exif.textconv exiftool
git config --global interactive.diffFilter "delta --color-only"
else
echo "Delta and exiftool binaries are required but not found."
echo "Delta: https://github.com/dandavison/delta"
echo "Exiftool: https://exiftool.org/"
fi
}
setup_diff_config() {
git config --global diff.algorithm histogram
git config --global diff.colorMoved default
git config --global diff.indentHeuristic true
git config --global diff.mnemonicPrefix true
git config --global diff.renames copies
git config --global difftool.prompt false
}
setup_fetch_config() {
git config --global fetch.prune true
git config --global fetch.pruneTags true
git config --global fetch.writeCommitGraph true
}
setup_misc_config() {
git config --global feature.experimental true
git config --global gc.cruftPacks true
git config --global grep.column true
git config --global grep.fullName true
git config --global grep.lineNumber true
git config --global init.defaultBranch main
git config --global interactive.singleKey true
git config --global maintenance.auto false
git config --global maintenance.strategy incremental
# call "git maintenance register" in repository's folder
git config --global pack.writeReverseIndex true
}
setup_merge_config() {
git config --global merge.conflictStyle diff3
git config --global merge.ff only
git config --global mergetool.prompt false
}
setup_push_config() {
git config --global push.autoSetupRemote true
git config --global push.default simple
git config --global push.followTags true
git config --global push.useForceIfIncludes true
}
setup_rebase_config() {
git config --global rebase.abbreviateCommands true
git config --global rebase.autoSquash true
git config --global rebase.autoStash true
git config --global rebase.updateRefs true
}
setup_rerere_config() {
git config --global rerere.autoUpdate true
git config --global rerere.enabled true
}
setup_url_config() {
git config --global url."https://bitbucket.org/".insteadOf bb:
git config --global url."https://github.com/".insteadOf gh:
git config --global url."https://gitlab.com/".insteadOf gl:
}
setup_misc_options() {
git config --global revert.reference true
git config --global status.showUntrackedFiles all
git config --global tag.sort version:refname
git config --global transfer.fsckObjects true
}
setup_gpg() {
local email="$1"
local name="$2"
local existing_key
existing_key=$(get_secret_keys "$email")
if [[ -z "$existing_key" ]]; then
gpg --quick-generate-key "$name <$email>" "ed25519/cert,sign+cv25519/encr"
existing_key=$(get_secret_keys "$email")
else
echo "GPG key already exists for the specified email."
fi
echo "If the GPG key is not already present, add it to the remote - run 'gpg --armor --export $existing_key'."
git config --global commit.gpgSign true
git config --global tag.forceSignAnnotated true
git config --global tag.gpgSign true
git config --global user.signingKey "${existing_key}"
}
setup_vscode() {
git config --global core.editor "code --wait"
git config --global diff.tool default-difftool
git config --global difftool.default-difftool.cmd "code --wait --diff \$LOCAL \$REMOTE"
git config --global merge.tool code
git config --global mergetool.code.cmd "code --wait --merge \$REMOTE \$LOCAL \$BASE \$MERGED"
}
setup_git_config() {
local email="$1"
local name="$2"
setup_user_info "$email" "$name"
setup_core_config
setup_branch_config
setup_color_config
if confirm "Do you want to set up delta (colorized git diff viewer)?"; then
setup_delta
fi
setup_diff_config
setup_fetch_config
setup_misc_config
setup_merge_config
setup_push_config
setup_rebase_config
setup_rerere_config
setup_url_config
setup_misc_options
}
reload_git_config() {
git config --list --show-origin
}
main() {
backup_config
read -rp "Enter your email: " email
read -rp "Enter your name: " name
setup_git_config "$email" "$name"
if confirm "Do you want to set up GPG key for signing commits?"; then
setup_gpg "$email" "$name"
fi
if exists "code" && confirm "Do you want to set up Visual Studio Code as your Git editor?"; then
setup_vscode
fi
reload_git_config
echo "Git configuration completed!"
}
main
[alias]
# Edit global config
conf = config --global --edit
# Amend the last commit
mnd = commit --all --amend --no-edit
# Undo last commit
undo = reset HEAD~1 --mixed
# Discard changes in the working directory
discard = checkout --
# Add patch
addp = add --patch
# Stash keep index
stashk = stash push --keep-index
# Amend the currently staged files to the latest commit
amend = mnd --reuse-message=HEAD
# Interactively rebase all the commits on the current branch
rebase-branch = "!f() { \
git rebase --interactive $(git merge-base HEAD ${1-main}); \
}; f"
# Interactive rebase with the given number of latest commits
reb = "!r() { \
git rebase --interactive HEAD~$1; \
}; r"
# Cherry-pick with no commit
pick = cherry-pick --no-commit
# Continue a rebase or merge
cont = rebase --continue
# Interactive rebase with fresh commits of the remote branch
promi = "!r() { \
git pull --rebase=interactive origin ${1-main}; \
}; r"
# Push force with lease and force if includes
pushf = push --force-with-lease --force-if-includes
# Pretty log
lg = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset)%C(bold yellow)%d%C(reset) %C(white)%s%C(reset) %C(bold green)(%ar)%C(reset)' --all
# New commits
new = lg main..HEAD
# Missing commits
missing = lg HEAD..main
# Commits on the current branch but not on main
ahead = "!git log main..HEAD --oneline"
# Rebase onto
rebase-onto = "!f() { \
git rebase --onto ${1-main} ${2-main}; \
}; f"
# Fetch all remotes and prune deleted branches
fp = fetch --all --prune
# Merge a branch without a fast-forward
mff = merge --no-ff
# Configure initialization
iint = "!f() { \
git init && \
git maintenance register && \
git commit --allow-empty --message 'chore: initial commit'; \
}; f"
# Remove all local branches already merged into main and start maintenance
cleanup = "!f() { \
git branch --merged main | grep -vE '(^\\*|main)' | sed 's/^ *//;s/ *$//' | xargs -r -n 1 git branch -d && \
git fsck && \
git maintenance run --task=gc && \
git repack -Ad && \
git rerere gc; \
}; f"
function Initialize-Environment {
[CmdletBinding()]
param()
Begin {
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
}
Process {
try {
# Check if starship is installed before invoking
if (Get-Command starship -ErrorAction SilentlyContinue) {
Invoke-Expression (& starship init powershell)
} else {
Write-Warning "Starship is not installed. Skipping initialization."
}
return $true
} catch {
Write-Error "Failed to initialize the environment: $($_.Exception.Message)"
return $false
}
}
}
function Update-SystemPackages {
[CmdletBinding()]
param (
[switch]$RestartComputer,
[switch]$LogOffUser,
[switch]$ShutdownComputer
)
Begin {
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
}
Process {
$updateFunctions = @(
@{
Name = "Scoop"
Function = {
if (Get-Command scoop -ErrorAction SilentlyContinue) {
scoop update --all --quiet
scoop cleanup --all --cache
scoop cache rm --all
} else {
Write-Warning "Scoop is not installed. Skipping Scoop updates."
}
}
},
@{
Name = "WinGet"
Function = {
if (Get-Command winget -ErrorAction SilentlyContinue) {
winget upgrade --all --silent --include-unknown
} else {
Write-Warning "WinGet is not installed. Skipping WinGet updates."
}
}
},
@{
Name = "WSL"
Function = {
if (Get-Command wsl -ErrorAction SilentlyContinue) {
wsl --update
wsl --user root -- sh -c 'apt update --yes && apt upgrade --yes && apt autoremove --yes'
wsl --user root -- sh -c 'if apt list --upgradable 2>/dev/null | grep -qv "Listing..."; then apt list --upgradable 2>/dev/null | awk -F/ "NR>1 {print \$1}" | xargs sudo apt install -y; else echo "No packages to upgrade"; fi'
} else {
Write-Warning "WSL is not installed. Skipping WSL updates."
}
}
}
)
foreach ($update in $updateFunctions) {
try {
Write-Host "Updating $($update.Name)..." -ForegroundColor Cyan
& $update.Function
} catch {
Write-Error "Failed to update $($update.Name): $($_.Exception.Message)"
}
}
# Perform system actions if specified
if ($RestartComputer) {
Restart-Computer -Force
} elseif ($LogOffUser) {
logoff
} elseif ($ShutdownComputer) {
Stop-Computer -Force
}
}
}
# Set alias for Update-SystemPackages
Set-Alias -Name upb -Value Update-SystemPackages
# Initialize environment
if (-not(Initialize-Environment)) {
Write-Warning "Environment initialization failed. Some features may not work as expected."
}
#!/usr/bin/env zsh
set -o nounset
set -o errexit
set -o pipefail
IFS=$'\n\t'
# Helper functions
is_readable() {
[[ -f "$1" && -r "$1" && -s "$1" ]]
}
exists() {
command -v "$1" &>/dev/null
}
# Custom z function
unalias z 2>/dev/null
z() {
if [ $# -gt 0 ]; then
zshz "$*" && return
fi
cd "$(zshz -l 2>&1 | fzf --height 40% --nth 2.. --reverse --inline-info +s --tac --query "${*##-* }" | sed 's/^[0-9,.]* *//')"
}
# Oh My Zsh configuration
export ZSH="$HOME/.oh-my-zsh"
DISABLE_MAGIC_FUNCTIONS="true"
ENABLE_CORRECTION="true"
HIST_STAMPS="yyyy-mm-dd"
# Antigen setup
ANTIGEN_FILE="$HOME/antigen.zsh"
if ! is_readable "${ANTIGEN_FILE}"; then
curl --location https://git.io/antigen >"${ANTIGEN_FILE}"
fi
source "${ANTIGEN_FILE}"
antigen use oh-my-zsh
antigen bundle zsh-users/zsh-autosuggestions
antigen bundle z-shell/F-Sy-H --branch=main
antigen apply
# Oh My Zsh plugins
plugins=(git z)
# Uncomment if you want menu-style completion
# zstyle ':completion:*' menu select
zstyle ':omz:plugins:git' aliases no
source "$ZSH/oh-my-zsh.sh"
# Aliases
# alias zshconfig='${EDITOR:-vim} ~/.zshrc && source ~/.zshrc'
alias zshconfig='code --wait ~/.zshrc && source ~/.zshrc'
alias qfind='find . -name '
alias gg='cd ~/Code/GitHub/nandordudas'
if exists eza; then
alias ls="eza -laF --icons --git"
else
alias ls="ls -laF"
fi
# NVM setup
# curl --output - https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
export NVM_DIR="$HOME/.nvm"
if is_readable "${NVM_DIR}/nvm.sh"; then
source "$NVM_DIR/nvm.sh"
fi
if is_readable "${NVM_DIR}/bash_completion"; then
source "${NVM_DIR}/bash_completion"
fi
# PNPM completion
# https://pnpm.io/completion
if ! exists pnpm; then
npm install --global pnpm@latest
fi
PNPM_COMPLETION_FILE="$HOME/completion-for-pnpm.zsh"
if ! is_readable "${PNPM_COMPLETION_FILE}"; then
pnpm completion zsh >"${PNPM_COMPLETION_FILE}"
fi
source "${PNPM_COMPLETION_FILE}"
# FZF setup
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# Starship prompt
if ! exists starship; then
curl --silent --show-error https://starship.rs/install.sh | sh
fi
eval "$(starship init zsh)"
# Key bindings
bindkey "${key[Up]}" fzf-history-widget
# Keep global Node.js packages up-to-date
# https://www.npmjs.com/package/taze
if ! exists taze; then
npm install --global taze
fi
taze latest --global --install
# Clean up
unset ANTIGEN_FILE PNPM_COMPLETION_FILE
unset -f is_readable exists
{
"Print to console": {
"scope": "typescript,typescriptreact,vue",
"prefix": "clog",
"body": ["console.log($0) // eslint-disable-line no-console"],
"description": "Log output to the console"
},
"Variable - const or let": {
"scope": "typescript,typescriptreact,vue",
"prefix": "$",
"body": ["${1|const,let|} ${3:{ username \\}} = ${2:{ username: 'John' \\}}"],
"description": "Create hoisted variable"
},
"Export module": {
"scope": "typescript,typescriptreact",
"prefix": "ex",
"body": ["export ${2:{ default as ${3:Component} \\}} from '$1'"],
"description": "Export module"
},
"Import module": {
"scope": "typescript,typescriptreact,vue",
"prefix": "im",
"body": ["import ${2:{ ${3:resolve} \\}} from '${1:node:path}'"],
"description": "Import module"
},
"Vitest it": {
"scope": "typescript,typescriptreact",
"prefix": "spec",
"body": [
"it('${1:should does not do much}', () => {",
" // arrange",
" ${2:const mockValue = true}",
"",
" // act and assert",
" ${4:expect(mockValue).toBeTruthy()}",
"})"
],
"description": "Create spec"
},
"Vitest describe": {
"scope": "typescript,typescriptreact",
"prefix": "suite",
"body": [
"describe('${1:${TM_FILENAME_BASE/^(.*)\\.spec$/${1:/pascalcase}/}}', () => {",
" ${2:spec}",
"",
" it.todo('should satisfy test case in the future')",
"})"
],
"description": "Create suite with optional spec"
}
}
[
/* */
{ "key": "shift+alt+right", "command": "-cursorWordEndRightSelect", "when": "editorTextFocus" },
{ "key": "shift+alt+left", "command": "-cursorWordStartLeftSelect", "when": "editorTextFocus" },
/* */
{ "key": "alt alt", "command": "workbench.action.showCommands", "when": "editorTextFocus" },
/* */
{ "key": "shift shift", "command": "workbench.action.quickOpen", "when": "editorTextFocus" }
]
function Update-UbuntuVersion {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]$PreviousVersion,
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]$NextVersion,
[Parameter(Mandatory = $false)]
[ValidateNotNullOrEmpty()]
[string]$WslPath = "E:\WSL"
)
Begin {
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
# Validate WSL is installed
if (-not (Get-Command wsl -ErrorAction SilentlyContinue)) {
throw "WSL is not installed or not in the system PATH."
}
}
Process {
try {
# Shutdown WSL
Write-Verbose "Shutting down WSL..."
wsl --shutdown
# Create a new directory for the WSL export
if (-not(Test-Path -Path $WslPath)) {
New-Item -ItemType Directory -Path $WslPath -Force | Out-Null
Write-Verbose "Created directory: $WslPath"
}
# Export the previous Ubuntu version to a .tar file
$exportPath = Join-Path -Path $WslPath -ChildPath "Ubuntu-$NextVersion.tar"
Write-Verbose "Exporting Ubuntu-$PreviousVersion to $exportPath..."
wsl --export "Ubuntu-$PreviousVersion" $exportPath
# Unregister the previous Ubuntu version
Write-Verbose "Unregistering Ubuntu-$PreviousVersion..."
wsl --unregister "Ubuntu-$PreviousVersion"
# Import the new Ubuntu version from the .tar file
$importPath = Join-Path -Path $WslPath -ChildPath "Ubuntu-$NextVersion"
Write-Verbose "Importing Ubuntu-$NextVersion to $importPath..."
wsl --import "Ubuntu-$NextVersion" $importPath $exportPath
# Set the new version as the default
Write-Verbose "Setting Ubuntu-$NextVersion as the default WSL distribution..."
wsl --set-default "Ubuntu-$NextVersion"
# Remove the old version's directory
$oldVersionPath = Join-Path -Path $WslPath -ChildPath "Ubuntu-$PreviousVersion"
if (Test-Path -Path $oldVersionPath) {
Write-Verbose "Removing old version directory: $oldVersionPath"
Remove-Item -Path $oldVersionPath -Force -Recurse
}
Write-Output "Ubuntu version updated from $PreviousVersion to $NextVersion."
}
catch {
Write-Error "An error occurred: $_"
}
finally {
# Clean up the temporary .tar file
if (Test-Path $exportPath) {
Remove-Item -Path $exportPath -Force
Write-Verbose "Removed temporary file: $exportPath"
}
}
}
}
# Example usage
# Update-UbuntuVersion -PreviousVersion "22.04" -NextVersion "23.10" -Verbose
# Update-UbuntuVersion -PreviousVersion "22.04" -NextVersion "23.10" -WslPath "D:\CustomWSLPath" -Verbose
{
/* */
"[vue]": {
"editor.defaultFormatter": "Vue.volar"
},
/* */
"[dotenv][json][jsonc][markdown][properties]": {
"editor.rulers": []
},
"[properties]": {
"editor.detectIndentation": false,
"editor.insertSpaces": false
},
/* antfu.file-nesting */
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.expand": false,
"explorer.fileNesting.patterns": {
"//": "Last update at 9/15/2024, 11:43:10 AM",
".clang-tidy": ".clang-format, .clangd, compile_commands.json",
".env": "*.env, .env.*, .envrc, env.d.ts",
".gitignore": ".gitattributes, .gitmodules, .gitmessage, .mailmap, .git-blame*",
".project": ".classpath",
"+layout.svelte": "+layout.ts,+layout.ts,+layout.js,+layout.server.ts,+layout.server.js,+layout.gql",
"+page.svelte": "+page.server.ts,+page.server.js,+page.ts,+page.js,+page.gql",
"ansible.cfg": "ansible.cfg, .ansible-lint, requirements.yml",
"app.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, capacitor.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, i18n.config.*, ionic.config.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, panda.config.*, playwright.config.*, postcss.config.*, puppeteer.config.*, rspack.config.*, sst.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, uno.config.*, unocss.config.*, vitest.config.*, vuetify.config.*, webpack.config.*, windi.config.*",
"artisan": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, capacitor.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, i18n.config.*, ionic.config.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, panda.config.*, playwright.config.*, postcss.config.*, puppeteer.config.*, rspack.config.*, server.php, sst.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, uno.config.*, unocss.config.*, vitest.config.*, vuetify.config.*, webpack.config.*, webpack.mix.js, windi.config.*",
"astro.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, capacitor.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, i18n.config.*, ionic.config.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, panda.config.*, playwright.config.*, postcss.config.*, puppeteer.config.*, rspack.config.*, sst.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, uno.config.*, unocss.config.*, vitest.config.*, vuetify.config.*, webpack.config.*, windi.config.*",
"build-wrapper.log": "build-wrapper*.log, build-wrapper-dump*.json, build-wrapper-win*.exe, build-wrapper-linux*, build-wrapper-macosx*",
"BUILD.bazel": "*.bzl, *.bazel, *.bazelrc, bazel.rc, .bazelignore, .bazelproject, WORKSPACE",
"Cargo.toml": ".clippy.toml, .rustfmt.toml, cargo.lock, clippy.toml, cross.toml, rust-toolchain.toml, rustfmt.toml",
"CMakeLists.txt": "*.cmake, *.cmake.in, .cmake-format.yaml, CMakePresets.json, CMakeCache.txt",
"composer.json": ".php*.cache, composer.lock, phpunit.xml*, psalm*.xml",
"default.nix": "shell.nix",
"deno.json*": "*.env, .env.*, .envrc, api-extractor.json, deno.lock, env.d.ts, import-map.json, import_map.json, jsconfig.*, tsconfig.*, tsdoc.*",
"Dockerfile": "*.dockerfile, .devcontainer.*, .dockerignore, captain-definition, compose.*, docker-compose.*, dockerfile*",
"flake.nix": "flake.lock",
"gatsby-config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, capacitor.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, gatsby-browser.*, gatsby-node.*, gatsby-ssr.*, gatsby-transformer.*, histoire.config.*, htmlnanorc.*, i18n.config.*, ionic.config.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, panda.config.*, playwright.config.*, postcss.config.*, puppeteer.config.*, rspack.config.*, sst.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, uno.config.*, unocss.config.*, vitest.config.*, vuetify.config.*, webpack.config.*, windi.config.*",
"gemfile": ".ruby-version, gemfile.lock",
"go.mod": ".air*, go.sum",
"go.work": "go.work.sum",
"hatch.toml": ".editorconfig, .flake8, .isort.cfg, .python-version, hatch.toml, requirements*.in, requirements*.pip, requirements*.txt, tox.ini",
"I*.cs": "$(capture).cs",
"Makefile": "*.mk",
"mix.exs": ".credo.exs, .dialyzer_ignore.exs, .formatter.exs, .iex.exs, .tool-versions, mix.lock",
"next.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, capacitor.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, i18n.config.*, ionic.config.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, next-env.d.ts, next-i18next.config.*, panda.config.*, playwright.config.*, postcss.config.*, puppeteer.config.*, rspack.config.*, sst.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, uno.config.*, unocss.config.*, vitest.config.*, vuetify.config.*, webpack.config.*, windi.config.*",
"nuxt.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .nuxtignore, .nuxtrc, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, capacitor.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, i18n.config.*, ionic.config.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, panda.config.*, playwright.config.*, postcss.config.*, puppeteer.config.*, rspack.config.*, sst.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, uno.config.*, unocss.config.*, vitest.config.*, vuetify.config.*, webpack.config.*, windi.config.*",
"package.json": "*.code-workspace, .browserslist*, .circleci*, .commitlint*, .cz-config.js, .czrc, .dlint.json, .dprint.json*, .editorconfig, .eslint*, .firebase*, .flowconfig, .github*, .gitlab*, .gitmojirc.json, .gitpod*, .huskyrc*, .jslint*, .knip.*, .lintstagedrc*, .markdownlint*, .node-version, .nodemon*, .npm*, .nvmrc, .pm2*, .pnp.*, .pnpm*, .prettier*, .pylintrc, .release-please*.json, .releaserc*, .ruff.toml, .sentry*, .simple-git-hooks*, .stackblitz*, .styleci*, .stylelint*, .tazerc*, .textlint*, .tool-versions, .travis*, .versionrc*, .vscode*, .watchman*, .xo-config*, .yamllint*, .yarnrc*, Procfile, apollo.config.*, appveyor*, azure-pipelines*, biome.json*, bower.json, build.config.*, bun.lockb, bunfig.toml, commitlint*, crowdin*, dangerfile*, dlint.json, dprint.json*, electron-builder.*, eslint*, firebase.json, grunt*, gulp*, jenkins*, knip.*, lerna*, lint-staged*, nest-cli.*, netlify*, nodemon*, npm-shrinkwrap.json, nx.*, package-lock.json, package.nls*.json, phpcs.xml, pm2.*, pnpm*, prettier*, pullapprove*, pyrightconfig.json, release-please*.json, release-tasks.sh, release.config.*, renovate*, rollup.config.*, rspack*, ruff.toml, simple-git-hooks*, sonar-project.properties, stylelint*, tslint*, tsup.config.*, turbo*, typedoc*, unlighthouse*, vercel*, vetur.config.*, webpack*, workspace.json, wrangler.toml, xo.config.*, yarn*",
"Pipfile": ".editorconfig, .flake8, .isort.cfg, .python-version, Pipfile, Pipfile.lock, requirements*.in, requirements*.pip, requirements*.txt, tox.ini",
"pubspec.yaml": ".metadata, .packages, all_lint_rules.yaml, analysis_options.yaml, build.yaml, pubspec.lock, pubspec_overrides.yaml",
"pyproject.toml": ".commitlint*, .dlint.json, .dprint.json*, .editorconfig, .eslint*, .flake8, .flowconfig, .isort.cfg, .jslint*, .lintstagedrc*, .markdownlint*, .pdm-python, .pdm.toml, .prettier*, .pylintrc, .python-version, .ruff.toml, .stylelint*, .textlint*, .xo-config*, .yamllint*, MANIFEST.in, Pipfile, Pipfile.lock, biome.json*, commitlint*, dangerfile*, dlint.json, dprint.json*, eslint*, hatch.toml, lint-staged*, pdm.lock, phpcs.xml, poetry.lock, poetry.toml, prettier*, pyproject.toml, pyrightconfig.json, requirements*.in, requirements*.pip, requirements*.txt, ruff.toml, setup.cfg, setup.py, stylelint*, tox.ini, tslint*, uv.lock, uv.toml, xo.config.*",
"quasar.conf.js": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, capacitor.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, i18n.config.*, ionic.config.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, panda.config.*, playwright.config.*, postcss.config.*, puppeteer.config.*, quasar.extensions.json, rspack.config.*, sst.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, uno.config.*, unocss.config.*, vitest.config.*, vuetify.config.*, webpack.config.*, windi.config.*",
"readme*": "AUTHORS, Authors, BACKERS*, Backers*, CHANGELOG*, CITATION*, CODEOWNERS, CODE_OF_CONDUCT*, CONTRIBUTING*, CONTRIBUTORS, COPYING*, CREDITS, Changelog*, Citation*, Code_Of_Conduct*, Codeowners, Contributing*, Contributors, Copying*, Credits, GOVERNANCE.MD, Governance.md, HISTORY.MD, History.md, LICENSE*, License*, MAINTAINERS, Maintainers, README-*, README_*, RELEASE_NOTES*, Readme-*, Readme_*, Release_Notes*, SECURITY.MD, SPONSORS*, Security.md, Sponsors*, authors, backers*, changelog*, citation*, code_of_conduct*, codeowners, contributing*, contributors, copying*, credits, governance.md, history.md, license*, maintainers, readme-*, readme_*, release_notes*, security.md, sponsors*",
"Readme*": "AUTHORS, Authors, BACKERS*, Backers*, CHANGELOG*, CITATION*, CODEOWNERS, CODE_OF_CONDUCT*, CONTRIBUTING*, CONTRIBUTORS, COPYING*, CREDITS, Changelog*, Citation*, Code_Of_Conduct*, Codeowners, Contributing*, Contributors, Copying*, Credits, GOVERNANCE.MD, Governance.md, HISTORY.MD, History.md, LICENSE*, License*, MAINTAINERS, Maintainers, README-*, README_*, RELEASE_NOTES*, Readme-*, Readme_*, Release_Notes*, SECURITY.MD, SPONSORS*, Security.md, Sponsors*, authors, backers*, changelog*, citation*, code_of_conduct*, codeowners, contributing*, contributors, copying*, credits, governance.md, history.md, license*, maintainers, readme-*, readme_*, release_notes*, security.md, sponsors*",
"README*": "AUTHORS, Authors, BACKERS*, Backers*, CHANGELOG*, CITATION*, CODEOWNERS, CODE_OF_CONDUCT*, CONTRIBUTING*, CONTRIBUTORS, COPYING*, CREDITS, Changelog*, Citation*, Code_Of_Conduct*, Codeowners, Contributing*, Contributors, Copying*, Credits, GOVERNANCE.MD, Governance.md, HISTORY.MD, History.md, LICENSE*, License*, MAINTAINERS, Maintainers, README-*, README_*, RELEASE_NOTES*, Readme-*, Readme_*, Release_Notes*, SECURITY.MD, SPONSORS*, Security.md, Sponsors*, authors, backers*, changelog*, citation*, code_of_conduct*, codeowners, contributing*, contributors, copying*, credits, governance.md, history.md, license*, maintainers, readme-*, readme_*, release_notes*, security.md, sponsors*",
"remix.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, capacitor.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, i18n.config.*, ionic.config.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, panda.config.*, playwright.config.*, postcss.config.*, puppeteer.config.*, remix.*, rspack.config.*, sst.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, uno.config.*, unocss.config.*, vitest.config.*, vuetify.config.*, webpack.config.*, windi.config.*",
"requirements.txt": ".editorconfig, .flake8, .isort.cfg, .python-version, requirements*.in, requirements*.pip, requirements*.txt, tox.ini",
"rush.json": "*.code-workspace, .browserslist*, .circleci*, .commitlint*, .cz-config.js, .czrc, .dlint.json, .dprint.json*, .editorconfig, .eslint*, .firebase*, .flowconfig, .github*, .gitlab*, .gitmojirc.json, .gitpod*, .huskyrc*, .jslint*, .knip.*, .lintstagedrc*, .markdownlint*, .node-version, .nodemon*, .npm*, .nvmrc, .pm2*, .pnp.*, .pnpm*, .prettier*, .pylintrc, .release-please*.json, .releaserc*, .ruff.toml, .sentry*, .simple-git-hooks*, .stackblitz*, .styleci*, .stylelint*, .tazerc*, .textlint*, .tool-versions, .travis*, .versionrc*, .vscode*, .watchman*, .xo-config*, .yamllint*, .yarnrc*, Procfile, apollo.config.*, appveyor*, azure-pipelines*, biome.json*, bower.json, build.config.*, bun.lockb, bunfig.toml, commitlint*, crowdin*, dangerfile*, dlint.json, dprint.json*, electron-builder.*, eslint*, firebase.json, grunt*, gulp*, jenkins*, knip.*, lerna*, lint-staged*, nest-cli.*, netlify*, nodemon*, npm-shrinkwrap.json, nx.*, package-lock.json, package.nls*.json, phpcs.xml, pm2.*, pnpm*, prettier*, pullapprove*, pyrightconfig.json, release-please*.json, release-tasks.sh, release.config.*, renovate*, rollup.config.*, rspack*, ruff.toml, simple-git-hooks*, sonar-project.properties, stylelint*, tslint*, tsup.config.*, turbo*, typedoc*, unlighthouse*, vercel*, vetur.config.*, webpack*, workspace.json, wrangler.toml, xo.config.*, yarn*",
"sanity.config.*": "sanity.cli.*, sanity.types.ts, schema.json",
"setup.cfg": ".editorconfig, .flake8, .isort.cfg, .python-version, MANIFEST.in, requirements*.in, requirements*.pip, requirements*.txt, setup.cfg, tox.ini",
"setup.py": ".editorconfig, .flake8, .isort.cfg, .python-version, MANIFEST.in, requirements*.in, requirements*.pip, requirements*.txt, setup.cfg, setup.py, tox.ini",
"shims.d.ts": "*.d.ts",
"svelte.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, capacitor.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, houdini.config.*, htmlnanorc.*, i18n.config.*, ionic.config.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, mdsvex.config.js, panda.config.*, playwright.config.*, postcss.config.*, puppeteer.config.*, rspack.config.*, sst.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, uno.config.*, unocss.config.*, vite.config.*, vitest.config.*, vuetify.config.*, webpack.config.*, windi.config.*",
"vite.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, capacitor.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, i18n.config.*, ionic.config.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, panda.config.*, playwright.config.*, postcss.config.*, puppeteer.config.*, rspack.config.*, sst.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, uno.config.*, unocss.config.*, vitest.config.*, vuetify.config.*, webpack.config.*, windi.config.*",
"vue.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, capacitor.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, i18n.config.*, ionic.config.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, panda.config.*, playwright.config.*, postcss.config.*, puppeteer.config.*, rspack.config.*, sst.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, uno.config.*, unocss.config.*, vitest.config.*, vuetify.config.*, webpack.config.*, windi.config.*",
"*.asax": "$(capture).*.cs, $(capture).*.vb",
"*.ascx": "$(capture).*.cs, $(capture).*.vb",
"*.ashx": "$(capture).*.cs, $(capture).*.vb",
"*.aspx": "$(capture).*.cs, $(capture).*.vb",
"*.axaml": "$(capture).axaml.cs",
"*.bloc.dart": "$(capture).event.dart, $(capture).state.dart",
"*.c": "$(capture).h",
"*.cc": "$(capture).hpp, $(capture).h, $(capture).hxx, $(capture).hh",
"*.cjs": "$(capture).cjs.map, $(capture).*.cjs, $(capture)_*.cjs",
"*.component.ts": "$(capture).component.html, $(capture).component.spec.ts, $(capture).component.css, $(capture).component.scss, $(capture).component.sass, $(capture).component.less",
"*.cpp": "$(capture).hpp, $(capture).h, $(capture).hxx, $(capture).hh",
"*.cs": "$(capture).*.cs",
"*.cshtml": "$(capture).cshtml.cs",
"*.csproj": "*.config, *proj.user, appsettings.*, bundleconfig.json",
"*.css": "$(capture).css.map, $(capture).*.css",
"*.cxx": "$(capture).hpp, $(capture).h, $(capture).hxx, $(capture).hh",
"*.dart": "$(capture).freezed.dart, $(capture).g.dart",
"*.db": "*.db-shm, *.db-wal",
"*.ex": "$(capture).html.eex, $(capture).html.heex, $(capture).html.leex",
"*.fs": "$(capture).fs.js, $(capture).fs.js.map, $(capture).fs.jsx, $(capture).fs.ts, $(capture).fs.tsx, $(capture).fs.rs, $(capture).fs.php, $(capture).fs.dart",
"*.go": "$(capture)_test.go",
"*.java": "$(capture).class",
"*.js": "$(capture).js.map, $(capture).*.js, $(capture)_*.js",
"*.jsx": "$(capture).js, $(capture).*.jsx, $(capture)_*.js, $(capture)_*.jsx, $(capture).less, $(capture).module.less, $(capture).module.less.d.ts, $(capture).scss, $(capture).module.scss, $(capture).module.scss.d.ts",
"*.master": "$(capture).*.cs, $(capture).*.vb",
"*.md": "$(capture).*",
"*.mjs": "$(capture).mjs.map, $(capture).*.mjs, $(capture)_*.mjs",
"*.module.ts": "$(capture).resolver.ts, $(capture).controller.ts, $(capture).service.ts",
"*.mts": "$(capture).mts.map, $(capture).*.mts, $(capture)_*.mts",
"*.pubxml": "$(capture).pubxml.user",
"*.py": "$(capture).pyi",
"*.razor": "$(capture).razor.cs, $(capture).razor.css, $(capture).razor.scss",
"*.resx": "$(capture).*.resx, $(capture).designer.cs, $(capture).designer.vb",
"*.tex": "$(capture).acn, $(capture).acr, $(capture).alg, $(capture).aux, $(capture).bbl, $(capture).blg, $(capture).fdb_latexmk, $(capture).fls, $(capture).glg, $(capture).glo, $(capture).gls, $(capture).idx, $(capture).ind, $(capture).ist, $(capture).lof, $(capture).log, $(capture).lot, $(capture).out, $(capture).pdf, $(capture).synctex.gz, $(capture).toc, $(capture).xdv",
"*.ts": "$(capture).js, $(capture).d.ts.map, $(capture).*.ts, $(capture)_*.js, $(capture)_*.ts",
"*.tsx": "$(capture).ts, $(capture).*.tsx, $(capture)_*.ts, $(capture)_*.tsx, $(capture).less, $(capture).module.less, $(capture).module.less.d.ts, $(capture).scss, $(capture).module.scss, $(capture).module.scss.d.ts, $(capture).css.ts",
"*.vbproj": "*.config, *proj.user, appsettings.*, bundleconfig.json",
"*.vue": "$(capture).*.ts, $(capture).*.js, $(capture).story.vue",
"*.w": "$(capture).*.w, I$(capture).w",
"*.xaml": "$(capture).xaml.cs"
},
/* */
"files.associations": {
".env*": "dotenv", /* mikestead.dotenv */
".gitconfig": "properties",
".nuxtrc": "properties"
},
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 1000,
/* */
"window.autoDetectColorScheme": true,
/* */
"workbench.iconTheme": "catppuccin-latte", /* Catppuccin.catppuccin-vsc-icons */
"workbench.preferredDarkColorTheme": "Maple Dark", /* subframe7536.theme-maple */
"workbench.preferredLightColorTheme": "Maple Light", /* subframe7536.theme-maple */
"workbench.productIconTheme": "icons-carbon", /* antfu.icons-carbon */
/* antfu.where-am-i */
"where-am-i.icon": "flame",
"where-am-i.textTransfrom": "none",
/* eamodio.gitlens */
"gitlens.codeLens.enabled": false,
"gitlens.currentLine.enabled": false,
"gitlens.menus": {
"editor": {
"blame": false,
"clipboard": true,
"compare": true,
"history": false,
"remote": false
},
"editorGroup": {
"blame": true,
"compare": false
}
},
/* usernamehw.errorlens */
"errorLens.fontFamily": "Maple Mono",
"errorLens.fontStyleItalic": true,
"errorLens.fontWeight": "600",
"errorLens.gutterIconsEnabled": true,
"errorLens.scrollbarHackEnabled": true,
/* streetsidesoftware.code-spell-checker */
"cSpell.allowCompoundWords": true,
"cSpell.userWords": [
"antfu",
"asax",
"ashx",
"astro",
"axaml",
"bazel",
"bazelignore",
"bazelproject",
"bazelrc",
"cascadia",
"catppuccin",
"clangd",
"clippy",
"codecov",
"codeimg",
"consolas",
"czrc",
"dlint",
"dprint",
"eamodio",
"envrc",
"gitmojirc",
"heex",
"histoire",
"huskyrc",
"isort",
"knip",
"latexmk",
"leex",
"lighthouserc",
"lintstagedrc",
"lockb",
"mdsvex",
"nuxt",
"nuxtignore",
"nuxtrc",
"phpcs",
"postcssrc",
"pylintrc",
"pyproject",
"pyrightconfig",
"releaserc",
"resx",
"rspack",
"rustfmt",
"scminput",
"styleci",
"tazerc",
"terserrc",
"tsdoc",
"tsup",
"unlighthouse",
"unocss",
"usernamehw",
"versionrc",
"vetur",
"vitest",
"vuetify",
"windi"
],
/* Vue.volar */
"vue.inlayHints.destructuredProps": true,
"vue.inlayHints.inlineHandlerLeading": true,
"vue.inlayHints.missingProps": true,
"vue.inlayHints.optionsWrapper": true,
"vue.inlayHints.vBindShorthand": true,
/* */
"javascript.inlayHints.enumMemberValues.enabled": true,
"javascript.inlayHints.functionLikeReturnTypes.enabled": true,
"javascript.inlayHints.parameterNames.enabled": "all",
"javascript.inlayHints.parameterTypes.enabled": true,
"javascript.inlayHints.propertyDeclarationTypes.enabled": true,
"javascript.inlayHints.variableTypes.enabled": true,
"javascript.updateImportsOnFileMove.enabled": "always",
/* subframe7536.codeimg */
"codeimg.showLineNumbers": false,
"codeimg.showWindowControls": false,
"codeimg.showWindowTitle": false,
"codeimg.windowControlsColor": false,
/* */
"editor.accessibilitySupport": "off",
"workbench.startupEditor": "none"
/* */
}
{
/* */
"breadcrumbs.enabled": false,
"breadcrumbs.icons": false,
"breadcrumbs.symbolPath": "off",
/* */
"chat.editor.wordWrap": "on",
/* */
"debug.onTaskErrors": "debugAnyway",
/* */
"diffEditor.experimental.showEmptyDecorations": true,
"diffEditor.experimental.showMoves": true,
"diffEditor.ignoreTrimWhitespace": false,
"diffEditor.renderSideBySide": false,
"diffEditor.wordWrap": "on",
"editor.acceptSuggestionOnEnter": "smart",
"editor.accessibilitySupport": "off",
"editor.colorDecorators": true,
"editor.copyWithSyntaxHighlighting": false,
"editor.cursorBlinking": "phase",
"editor.cursorSmoothCaretAnimation": "explicit",
"editor.cursorStyle": "underline-thin",
"editor.detectIndentation": false,
"editor.emptySelectionClipboard": false,
"editor.find.addExtraSpaceOnTop": false,
"editor.find.autoFindInSelection": "multiline",
"editor.foldingImportsByDefault": false,
"editor.fontFamily": "Maple Mono, Cascadia Code, Consolas, monospace",
"editor.fontLigatures": "'cv02', 'cv03', 'cv04'",
"editor.fontSize": 13,
"editor.fontWeight": 300,
"editor.formatOnSave": false,
"editor.formatOnSaveMode": "modificationsIfAvailable",
"editor.gotoLocation.multipleDeclarations": "goto",
"editor.gotoLocation.multipleDefinitions": "goto",
"editor.gotoLocation.multipleImplementations": "goto",
"editor.gotoLocation.multipleReferences": "goto",
"editor.gotoLocation.multipleTypeDefinitions": "goto",
"editor.guides.bracketPairs": "active",
"editor.guides.bracketPairsHorizontal": false,
"editor.guides.indentation": false,
"editor.hideCursorInOverviewRuler": true,
"editor.hover.delay": 300,
"editor.hover.enabled": true,
"editor.hover.sticky": true,
"editor.inlayHints.enabled": "offUnlessPressed",
"editor.inlayHints.fontFamily": "Maple Mono",
"editor.inlayHints.fontSize": 12,
"editor.inlayHints.padding": true,
"editor.inlineSuggest.enabled": true,
"editor.inlineSuggest.fontFamily": "Maple Mono",
"editor.inlineSuggest.suppressSuggestions": true,
"editor.insertSpaces": true,
"editor.lightbulb.enabled": "off",
"editor.lineHeight": 1.7,
"editor.lineNumbers": "off",
"editor.linkedEditing": true,
"editor.matchBrackets": "near",
"editor.minimap.enabled": false,
"editor.occurrencesHighlight": "off",
"editor.overviewRulerBorder": false,
"editor.padding.top": 16,
"editor.parameterHints.enabled": true,
"editor.quickSuggestions": {
"comments": "off",
"other": "off",
"strings": "on"
},
"editor.quickSuggestionsDelay": 10,
"editor.renderControlCharacters": false,
"editor.renderLineHighlight": "none",
"editor.renderWhitespace": "none",
"editor.rulers": [
{
"color": "#9AD6A440",
"column": 80
},
{
"color": "#F49A9A40",
"column": 120
}
],
"editor.selectionHighlight": false,
"editor.smoothScrolling": true,
"editor.snippetSuggestions": "inline",
"editor.suggest.localityBonus": true,
"editor.suggest.selectionMode": "whenQuickSuggestion",
"editor.suggest.showStatusBar": true,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.suggestFontSize": 12,
"editor.suggestLineHeight": 24,
"editor.suggestOnTriggerCharacters": true,
"editor.suggestSelection": "first",
"editor.tabCompletion": "off",
"editor.tabSize": 2,
"editor.wordBasedSuggestions": "matchingDocuments",
"editor.wordWrap": "wordWrapColumn",
"editor.wordWrapColumn": 120,
"editor.wrappingIndent": "indent",
"editor.wrappingStrategy": "advanced",
/* */
"explorer.compactFolders": true,
"explorer.confirmDelete": false,
"explorer.confirmDragAndDrop": false,
"explorer.sortOrder": "type",
/* */
"files.encoding": "utf8",
"files.eol": "\n",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
/* */
"git.allowForcePush": true,
"git.allowNoVerifyCommit": true,
"git.alwaysShowStagedChangesResourceGroup": true,
"git.autofetch": true,
"git.autoStash": true,
"git.branchProtection": [
"main"
],
"git.confirmForcePush": false,
"git.confirmNoVerifyCommit": false,
"git.confirmSync": false,
"git.decorations.enabled": false,
"git.enableCommitSigning": true,
"git.enableSmartCommit": true,
"git.fetchOnPull": true,
"git.followTagsWhenSync": true,
"git.inputValidation": true,
"git.openDiffOnClick": false,
"git.pruneOnFetch": true,
"git.pullBeforeCheckout": true,
"git.replaceTagsWhenPull": true,
"git.untrackedChanges": "separate",
/* */
"problems.decorations.enabled": false,
"problems.showCurrentInStatus": true,
/* */
"remote.autoForwardPortsSource": "hybrid",
/* */
"scm.defaultViewMode": "tree",
"scm.diffDecorations": "gutter",
"scm.diffDecorationsGutterPattern": {
"added": true,
"modified": true
},
"scm.compactFolders": true,
"scm.diffDecorationsGutterVisibility": "hover",
"scm.diffDecorationsGutterWidth": 2,
"scm.inputFontFamily": "Maple Mono",
"scm.inputFontSize": 12,
/* */
"search.exclude": {
"**/.git": true,
"**/.github": true,
"**/.gitlab": true,
"**/.nuxt": true,
"**/.output": true,
"**/.pnpm": true,
"**/.turbo": true,
"**/.vscode": true,
"**/.yarn": true,
"**/bower_components": true,
"**/build/**": true,
"**/CHANGELOG*": true,
"**/coverage": true,
"**/dist/**": true,
"**/LICENSE*": true,
"**/logs": true,
"**/node_modules": true,
"**/package-lock.json": true,
"**/pnpm-lock.yaml": true,
"**/public": true,
"**/tmp": true,
"**/yarn.lock": true
},
"search.mode": "newEditor",
"search.searchOnType": true,
"search.seedWithNearestWord": true,
"search.showLineNumbers": false,
"search.useIgnoreFiles": false,
/* */
"task.reconnection": true,
/* */
"terminal.integrated.autoReplies": {
"[oh-my-zsh] Would you like to update? [Y/n]": "Y\r"
},
"terminal.integrated.cursorBlinking": true,
"terminal.integrated.cursorStyle": "underline",
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.fontFamily": "Maple Mono NF, Cascadia Mono, Consolas, monospace",
"terminal.integrated.fontSize": 13,
"terminal.integrated.fontWeight": 300,
"terminal.integrated.lineHeight": 1.3,
"terminal.integrated.persistentSessionReviveProcess": "never",
"terminal.integrated.rescaleOverlappingGlyphs": true,
"terminal.integrated.smoothScrolling": true,
/* */
"typescript.inlayHints.enumMemberValues.enabled": true,
"typescript.inlayHints.functionLikeReturnTypes.enabled": true,
"typescript.inlayHints.parameterNames.enabled": "all",
"typescript.inlayHints.parameterTypes.enabled": true,
"typescript.inlayHints.propertyDeclarationTypes.enabled": true,
"typescript.inlayHints.variableTypes.enabled": true,
"typescript.preferences.preferTypeOnlyAutoImports": true,
"typescript.updateImportsOnFileMove.enabled": "always",
/* */
"window.commandCenter": false,
/* */
"workbench.activityBar.location": "bottom",
"workbench.editor.closeOnFileDelete": true,
"workbench.editor.doubleClickTabToToggleEditorGroupSizes": "off",
"workbench.editor.enablePreview": true,
"workbench.editor.enablePreviewFromQuickOpen": false,
"workbench.editor.highlightModifiedTabs": true,
"workbench.editor.limit.enabled": true,
"workbench.editor.limit.perEditorGroup": true,
"workbench.editor.limit.value": 8,
"workbench.editor.showTabs": "multiple",
"workbench.editor.tabActionCloseVisibility": false,
"workbench.list.smoothScrolling": true,
"workbench.sideBar.location": "right",
"workbench.startupEditor": "none",
"workbench.statusBar.visible": true,
"workbench.tips.enabled": false,
"workbench.tree.indent": 15
/* */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment