Repository: Vets-Who-Code/windows-dev-guide Branch: main Commit: c338c3441383 Files: 4 Total size: 74.0 KB Directory structure: gitextract_kn4j4ygh/ ├── .gitignore ├── .markdownlint.json ├── README.md └── README_cn.md ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ .vscode .DS_Store ================================================ FILE: .markdownlint.json ================================================ { "MD033": false, "MD013": false, "MD041": false, "MD029": false } ================================================ FILE: README.md ================================================

Microsoft Windows Logo

Windows Web Developer Setup Guide (2024)

English | [中文](./README_cn.md) - [🔭 Overview](#-overview) - [☑ Prerequisites](#-prerequisites) - [🐧 WSL](#-wsl) - [Installing WSL 2](#installing-wsl-2) - [User Config](#user-config) - [Updating Linux](#updating-linux) - [Mapping Your Linux Drive](#mapping-your-linux-drive) - [Pin Your Code Directory](#pin-your-code-directory) - [Restarting WSL](#restarting-wsl) - [👨‍💻 Windows Terminal](#-windows-terminal) - [Installing Windows Terminal](#installing-windows-terminal) - [Terminal Settings](#terminal-settings) - [Default Profile](#default-profile) - [Starting Directory](#starting-directory) - [📝 Git Config](#-git-config) - [Name](#name) - [Email](#email) - [Username](#username) - [GitHub CLI Installation](#github-cli-installation) - [GitHub CLI Configuration](#github-cli-configuration) - [Creating your Personal Access Token](#creating-your-personal-access-token) - [Git Credential Manager](#git-credential-manager) - [Storing Your Token](#storing-your-token) - [💤 Zsh](#-zsh) - [Installing Zsh](#installing-zsh) - [OhMyZsh](#ohmyzsh) - [cURL](#curl) - [Installing OhMyZsh](#installing-ohmyzsh) - [More Plugins](#more-plugins) - [zsh-autosuggestions](#zsh-autosuggestions) - [zsh-syntax-highlighting](#zsh-syntax-highlighting) - [📦 Node.js](#-nodejs) - [NVM](#nvm) - [Installing and Updating NVM](#installing-and-updating-nvm) - [Changing Node Versions](#changing-node-versions) - [NPM](#npm) - [New Projects](#new-projects) - [package.json](#packagejson) - [Installing Modules](#installing-modules) - [Dependencies](#dependencies) - [Developer Dependencies](#developer-dependencies) - [Batch Installing](#batch-installing) - [Uninstalling](#uninstalling) - [Versioning](#versioning) - [package-lock.json](#package-lockjson) - [Scripts](#scripts) - [💻 Visual Studio Code](#-visual-studio-code) - [Installing VS Code](#installing-vs-code) - [Remote Extension](#remote-extension) - [Changing the Default Shell](#changing-the-default-shell) - [Install the Vets Who Code Extension Pack](#install-the-vets-who-code-extension-pack) - [Install the Vets Who Code Theme for VS Code](#install-the-vets-who-code-theme-for-vs-code) - [More Extensions](#more-extensions) - [🍫 Chocolatey](#-chocolatey) - [Admin Shell](#admin-shell) - [Option 1](#option-1) - [Option 2](#option-2) - [Option 3](#option-3) - [Option 4](#option-4) - [Installing Chocolatey](#installing-chocolatey) - [Basic Chocolatey Commands](#basic-chocolatey-commands) - [Windows Apps](#windows-apps) - [🪜 Chrome Extensions](#-chrome-extensions) - [🇺🇸 VetsWhoCode Web App](#-vetswhocode-web-app) - [🐍 Python](#-python) - [pip](#pip) - [venv](#venv) - [Flask](#flask) - [Django](#django) - [JupyterLab](#jupyterlab) - [Notebook](#notebook) - [Voilà](#voilà) - [Python VS Code Extensions](#python-vs-code-extensions) - [PyCharm](#pycharm) - [💎 Ruby](#-ruby) - [Rails](#rails) - [Ruby VS Code Extensions](#ruby-vs-code-extensions) - [Docker](#docker) - [Docker Installation](#docker-installation) - [Option 1](#option-1-1) - [Option 2](#option-2-1) - [Test Docker CLI](#test-docker-cli) - [Docker Basics](#docker-basics) - [Docker CLI](#docker-cli) - [Additional Docker Resources](#additional-docker-resources) - [📚 References](#-references) ## 🔭 Overview After a lot of trial and error, I've been able to piece together a pretty respectable Windows dev environment. While there are numerous guides available, I noticed a lack of comprehensive coverage. In this guide, I've aimed to provide a holistic overview without delving too deeply into specific topics, in the hopes of ensuring a seamless developer experience for the majority of users.

Windows 11 desktop screenshot with a WSL2 Windows Terminal open

## ☑ Prerequisites - Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11 [(Which version do I have?)](https://support.microsoft.com/en-us/topic/628bec99-476a-2c13-5296-9dd081cdd808) - A [GitHub](https://github.com) account ## 🐧 WSL The first and most important part of setting up your Windows dev environment is installing the Windows Subsystem for Linux (WSL). I recommend sticking with Ubuntu but feel free to try out as many distributions as you like. There are no issues with having multiple distributions installed at once. ### Installing WSL 2 WSL 2 is the latest version of WSL, adding new features like a full Linux kernel and full system call compatibility. There used to be a handful of steps needed to install it, but we now only need to enter the following command into PowerShell or Command Prompt: ```sh wsl --install ``` This command does the following: - Enables the optional WSL and Virtual Machine Platform components - Downloads and installs the latest Linux kernel - Sets WSL 2 as the default - Downloads and installs the Ubuntu Linux distribution (a reboot may be required) Using the `--install` command defaults to Ubuntu and only works if WSL is not installed yet. If you would like to change your default Linux distribution, [follow these docs](https://docs.microsoft.com/en-us/windows/wsl/install#change-the-default-Linux-distribution-installed). ### User Config Once the process of installing your Linux distribution with WSL is complete, open the distribution (Ubuntu by default) using the Start menu. You will be asked to create a User Name and Password for your Linux distribution. When you enter your new password, nothing will display in the terminal. Your keyboard is still working! It is just a security feature. - This User Name and Password is specific to each separate Linux distribution that you install and has no bearing on your Windows user name. - Once you create a User Name and Password, the account will be your default user for the distribution and automatically sign in on launch. - This account will be considered the Linux administrator, with the ability to run sudo (Super User Do) administrative commands. - Each Linux distribution running on WSL has its own Linux user accounts and passwords. You will have to configure a Linux user account every time you add a distribution, reinstall, or reset. ### Updating Linux It is recommended that you regularly update and upgrade your packages. In Ubuntu or Debian, we use the `apt` package manager: ```sh sudo apt update && sudo apt upgrade ``` Windows does not automatically update or upgrade your Linux distribution(s). This is a task that most Linux users prefer to control themselves. ### Mapping Your Linux Drive When you open the Windows file explorer, it displays your devices and drives. We are going to add our Ubuntu virtual drive as a network location for easy access. 1. Open the `\\wsl$\` location from file explorer:

File explorer search bar

2. Right-click on the Ubuntu folder, and select `Map network drive`:

Mapping network drive

3. Select the drive letter you would like to use, leave `Reconnect at sign-in` checked and `Connect using different credentials` unchecked, and then click finish (mine will look slightly different because it's already been done):

Mapping network drive

4. The result should look something like this:

File explorer

If you wanted to access your Windows files from the Linux terminal, they are found in the `/mnt/` directory, so your Windows user directory would be located at `/mnt/c/Users/username`. With your Ubuntu drive mapped, you can easily drag/drop or copy/paste Windows files to the Linux file system by using the file explorer. However, it is recommended to store your project files on the Linux file system. It will be much faster than accessing files from Windows and it can also be a little buggy. #### Pin Your Code Directory Another quick tip I have is to create a code directory inside of Ubuntu, and then pin it to the quick access menu found on the left side of the file explorer. This comes in handy when transferring files quickly between Windows and Linux. 1. Open File Explorer and click on the Ubuntu network drive we created 2. Select the home dir, and then your user directory 3. Right-click and create a new folder, name it code, or anything else you'd like 4. Drag that new folder to the left, underneath the star icon that says `Quick access`

My code directory

### Restarting WSL If for some reason WSL stops working, you can restart it with these two commands from PowerShell/Command Prompt: ```sh wsl.exe --shutdown wsl.exe ``` If you return to your Linux shell everything should be normal. ## 👨‍💻 Windows Terminal To launch a Linux terminal we currently need to use the Ubuntu icon from the Start menu or enter the `wsl` or `bash` commands into PowerShell/Command Prompt. Another option that will give us more features like tabs, split views, themes, transparency, and key bindings, is to use the Windows Terminal. There are also a few other terminals like [Cmder](https://cmder.net/), [ConEmu](https://conemu.github.io/), or [Hyper](https://hyper.is/), but in my experience, Windows Terminal works extremely well. ### Installing Windows Terminal Windows 11 comes with Windows Terminal by default, but If you are using Windows 10, Download and install Windows Terminal through the [Microsoft Store](https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?rtc=1&activetab=pivot:overviewtab). ### Terminal Settings A few quick things I recommend setting up are the default profile and your starting home directory. These settings make it so launching Windows Terminal will open directly into WSL inside our user's home directory. #### Default Profile Windows Terminal will open a PowerShell or Command Prompt shell when launched by default, here is how to switch it to WSL: 1. Select the `˅` icon from Windows Terminal and go to the Settings menu:

Windows terminal settings

2. In the Startup section you will find the Default profile dropdown, select Ubuntu. Below it, select Windows Terminal as the Default terminal application:

Default shell profile

#### Starting Directory A default Ubuntu terminal will open to the root directory. To make finding your files a little quicker we can have it open into your home directory instead. 1. Under the Profiles section in the settings menu click on Ubuntu 2. At the General tab, you will find a Starting directory input 3. Enter the following replacing "username" with your Ubuntu user name: `\home\username` 4. You can leave the `Use parent process directory` box unchecked

Starting directory in Ubuntu terminal

There are many more settings to explore, and there is also a JSON file you can edit for more advanced customizations. Check out [this guide](https://www.ubuntupit.com/best-windows-terminal-themes-and-color-schemes/) for some popular Windows Terminal themes and how to install them. ## 📝 Git Config Git should come pre-installed on most, if not all of the WSL Linux distributions. To ensure you have the latest version, use the following command in an Ubuntu or Debian-based distro: ```sh sudo apt install git ``` ### Name To set up your Git config file, open a WSL command line and set your name with this command (replacing "Your Name" with your preferred username): ```sh git config --global user.name "Your Name" ``` ### Email Set your email with this command (replacing "youremail@domain.com" with the email you prefer): ```sh git config --global user.email "youremail@domain.com" ``` ### Username And finally, add your GitHub username to link it to git (case sensitive!): ```sh git config --global user.username "GitHub username" ``` Make sure you are inputting `user.username` and not `user.name` otherwise, you will overwrite your name and you will not be correctly synced to your GitHub account. You can double-check any of your settings by typing `git config --global user.name` and so on. To make any changes just type the necessary command again as in the examples above. ## GitHub CLI Installation Download binaries from the official source: ```sh (type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y)) \ && sudo mkdir -p -m 755 /etc/apt/keyrings \ && wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \ && sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \ && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ && sudo apt update \ && sudo apt install gh -y ``` Once the CLI is installed, run this command to update: ```sh sudo apt update && sudo apt install gh ``` ## GitHub CLI Configuration Enter this command in the terminal: ```sh gh auth login ``` Follow the prompts to authenticate your GitHub account. ### Creating your Personal Access Token GitHub has removed the ability to use a conventional password when working in a remote repository. You are now required to create a personal access token instead. >Personal access tokens (PATs) are an alternative to using passwords for authentication to GitHub when using the [GitHub API](https://docs.github.com/en/rest/overview/other-authentication-methods#via-oauth-and-personal-access-tokens) or the [command line](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#using-a-token-on-the-command-line). Follow [these docs](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) for step-by-step instructions on creating your personal token. ### Git Credential Manager Once you enter your token the first time, it can be stored via [Git Credential Manager (GCM)](https://github.com/GitCredentialManager/git-credential-manager) so you won't have to authenticate yourself each time. You can have Git installed in WSL and also in Windows at the same time. [Git for Windows](https://gitforwindows.org/) includes GCM.

Windows Git Installer Menu

You can also download the [latest installer for Windows](https://github.com/GitCredentialManager/git-credential-manager/releases/latest) to install the GCM standalone version. ### Storing Your Token Once Git Credential Manager is installed you can set it up for use with WSL. Open your WSL terminal and enter this command: ```sh git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/libexec/git-core/git-credential-manager-core.exe" ``` Note: If you ever receive the following error message: ```sh /mnt/c/Program\ Files/Git/mingw64/libexec/git-core/git-credential-manager-core.exe store: 1: /mnt/c/Program Files/Git/mingw64/libexec/git-core/git-credential-manager-core.exe: not found ``` Try using this command: ```sh git config --global credential.helper store ``` ## 💤 Zsh Z shell works almost identically to the standard BASH shell found on default Linux installs. What makes it different is its support for plugins and themes, along with some extra features like spelling correction and recursive path expansion. It's time to throw BASH in the trash! ### Installing Zsh Zsh can be installed with one command: ```sh sudo apt install zsh ``` After installing, type the `zsh` command. Zsh will ask you to choose some configurations. We will do this later on while installing oh-my-zsh, so choose option `0` to create the config file and prevent this message from showing again. ### OhMyZsh The most popular plugin framework by far is [OhMyZsh](https://ohmyz.sh/). It comes preloaded with loads of plugins, themes, helpers, and more. It can help with productivity for sure, but more importantly, it just looks cool 😎. ### cURL First off, we need to make sure we have [cURL](https://curl.se/) installed. Short for "Client URL", it's a way to transfer data from the command line, and that's how we will download OhMyZsh. ```sh sudo apt install curl ``` ### Installing OhMyZsh Enter the following command into your terminal to install OhMyZsh: ```sh sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" ``` That's it! You should now see a `.oh-my-zsh` directory inside of your home directory. To change your plugins and themes you will need to edit your `.zshrc` file, also found in your home dir. Here is a list of all the [themes](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes) and [plugins](https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins) that come bundled with OhMyZsh. ### More Plugins There are countless plugins available, but these are the two I recommend most. #### [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions) Autosuggestions for zsh, It suggests commands as you type based on history and completions. 1. Clone this repository into `$ZSH_CUSTOM/plugins` (by default `~/.oh-my-zsh/custom/plugins`) ```sh git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions ``` 2. Add the plugin to the list of plugins for Oh My Zsh to load (inside `~/.zshrc`): ```sh plugins=(git zsh-autosuggestions) ``` 3. Start a new terminal session. #### [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting) This package provides syntax highlighting for the shell zsh. It enables the highlighting of commands whilst they are typed at a zsh prompt into an interactive terminal. This helps in reviewing commands before running them, particularly in catching syntax errors. 1. Clone this repository in oh-my-zsh's plugins directory: ```sh git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting ``` 2. Activate the plugin in `~/.zshrc`: ```sh plugins=(git zsh-autosuggestions zsh-syntax-highlighting) ``` 3. Start a new terminal session. A huge list of plugins can be found at the [awesome zsh plugins repo](https://github.com/unixorn/awesome-zsh-plugins). ## 📦 Node.js Node.js is a JavaScript runtime environment that executes JavaScript code outside a web browser. It allows us to install packages, run local web servers, create APIs, and more. ### NVM You will likely need to switch between multiple versions of Node.js based on the needs of the different projects you're working on. Node Version Manager allows you to quickly install and use different versions of Node via the command line. #### Installing and Updating NVM 1. Open your terminal and install NVM with `curl` or `wget`: ```sh curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash ``` ```sh wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash ``` To verify installation, enter: ```sh command -v nvm ``` This should return 'nvm', if you receive 'command not found' or no response at all, close your current terminal, reopen it, and try again. 2. List which versions of Node are currently installed (should be none at this point): ```sh nvm ls ``` This will show Node is not currently installed, and lists all versions available for install. 1. Install both the current and stable LTS versions of Node.js. Install the current stable LTS release of Node.js (recommended for production applications): ```sh nvm install --lts ``` Install the current release of Node.js (for testing the latest Node.js features and improvements, but more likely to have issues): ```sh nvm install node ``` 4. List what versions of Node are installed: ```sh nvm ls ``` Now you should see the two versions that you just installed listed.

Ubuntu terminal displaying node installed

5. Verify that Node.js is installed and the current version: ```sh node -v ``` Then verify that you have NPM installed as well: ```sh npm --version ``` #### Changing Node Versions Use the following commands to change the version of Node you would like to use for any given project: _Switch to the LTS version:_ ```sh nvm use --lts ``` You can also use the specific number for any additional versions you've installed: ```sh nvm use v23.1.0 ``` To list all of the versions of Node.js available, use the command: `nvm ls-remote`. ### NPM Node Package Manager is the default package manager for Node.js. It is a command-line tool used to download or publish packages and manage the dependencies of a project. There is a searchable repository of all available NPM packages at [https://www.npmjs.com/](https://www.npmjs.com/). To list your current installed version of NPM: ```sh npm -v ``` #### New Projects When creating a new project that will utilize NPM, it must be initialized with the `init` command. First, make sure you are in the root directory of your project, and then use the following command: ```sh npm init ``` #### package.json `npm init` generates a `package.json` file and will prompt you for the metadata of your project. This includes things like the name, version, description, and license. You can think of it as the blueprint of your project as it will also contain the packages it depends on. The metadata can be changed at any time by editing the `package.json` file after the initialization. If you would like to automatically populate the initialization with all the default values, you may add the `--yes` flag. ```sh npm init --yes ``` #### Installing Modules Modules are installed via the `npm install` or `npm i` command. ```sh npm install react ``` The above command will install the React module as a dependency in `package.json`. We can also install NPM packages globally on our system. This is useful for utilities like command line interfaces. [Yarn](https://yarnpkg.com/) is another widely used node package manager, if we wanted to use it on all our node projects we would need the `--global` or `-g` flag. ```sh npm install --global yarn ``` #### Dependencies You can save a module as either a dependency or a developer dependency. A dependency would be something that your project cannot function properly without. The `--save` flag used to be needed to install modules as a dependency, but it is now done automatically with the `install` command. ```sh npm install --save gray-matter ``` Is the same as: ```sh npm install gray-matter ```

VS Code displaying the dependencies section of package.json

#### Developer Dependencies A developer dependency would be the modules used to build the project, not run it. This would include things like linters and testing tools. Developer dependencies are added with the `--save-dev` or `-D` flag. This adds the module to the `devDependencies` section of `package.json` ```sh npm install --save-dev husky ```

VS Code displaying the developer dependencies section of package.json

#### Batch Installing Apart from installing a single module, you can install all modules that are listed as `dependencies` and `devDependencies`: ```sh npm install ``` This will install all modules listed in the `package.json` of your current directory. If we only wanted to install the dependencies needed to run our project, the `--production` flag is used: ```sh npm install --production ``` the `--production` flag will only install the modules from the `dependencies` section of `package.json` and ignore the `devDependencies`. The perk of this is notably reducing the size of the `node_modules` folder. #### Uninstalling Removing modules works in the same way as installing them. Flags will need to be used for any global or developer dependencies. _Dependencies:_ ```sh npm uninstall react ``` _Developer Dependencies:_ ```sh npm uninstall --save-dev husky ``` _Global Installs:_ ```sh npm uninstall --global yarn ``` #### Versioning Package versions are identified with major, minor, and patch releases. `8.1.1` would be major version 8, minor version 1, and patch version 1. You can specify an exact version number by using the `@` symbol. ```sh npm install react@17.0.1 ``` Two more symbols we can use are `^` and `~`. `^` is the latest minor release. For example, `npm install ^8.1.1` specification might install version `8.3.1` if that's the latest minor version. `~` is the latest patch release. In the same way as minor releases, `npm install ~8.1.1` could install version `8.1.6` if that's the latest patch version available. When using the `npm install` or `npm i` command, the latest minor version will be used. #### package-lock.json The exact package versions will be documented in a generated `package-lock.json` file. The values found inside the `dependencies` and `devDependencies` objects of the `package.json` file include a range of acceptable versions of each package to install. `package-lock.json` is generated by the `npm install` command and contains the _exact_ versions of the dependencies used. #### Scripts `package.json` also contains a `scripts` property that can be defined to run command-line tools installed on the current project. This can include things like running tests, formatting your code, and launching a local server.

VS Code displaying the scripts section of package.json

NPM scripts are run by using the `run` command. With the above configuration, you would use the following command to have prettier format your code: ```sh npm run format ``` The keys in the scripts object are the command names and the values are the actual commands. _Check out the official [NPM](https://docs.npmjs.com/), [NVM](https://github.com/nvm-sh/nvm), and [Node.js](https://nodejs.org/en/docs/) docs for more in-depth guides._ ## 💻 Visual Studio Code There are many amazing code editors available for free, but Visual Studio Code our favorite and recommended by VetsWhoCode. ### Installing VS Code VS Code is available on Windows, macOS, and Linux. You can download the latest Windows installer [here](https://code.visualstudio.com/download). During installation, be sure to select the **Add to PATH** option, allowing you to open a folder in WSL from the Windows terminal. ### Remote Extension Install the [Remote Development Extension Pack](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack). >This allows you to use WSL as your integrated development environment and will handle compatibility and pathing for you. [Learn more](https://code.visualstudio.com/docs/remote/remote-overview). This extension will also allow you to launch VS Code right from your WSL terminal by using the `code` command. If I were inside the root directory of my repository, I would use `code .` to launch the entire directory inside VS Code. ```sh cd my-project code . ``` ### Changing the Default Shell The WSL2 shell can be chosen as the default VS Code terminal by pressing Ctrl + Shift + P and typing/choosing Terminal: Select Default Profile, then selecting zsh:

VSCode default shell

VSCode default shell

### Install the Vets Who Code Extension Pack [VetsWhoCode Extension Pack](https://marketplace.visualstudio.com/items?itemName=VetsWhoCode.vetswhocode-extension-pack) - Extension Pack for new veterans learning javascript at #VetsWhoCode ### Install the Vets Who Code Theme for VS Code [HashFlag Theme](https://marketplace.visualstudio.com/items?itemName=OfficialVetsWhoCode.HashFlag) - A High contrast programming theme inspired by the colors of Vets Who Code. ### More Extensions The number of extensions available for VS Code can be overwhelming, here are some useful extenstions: - [Auto Close Tag](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-close-tag) - Automatically add HTML/XML close tag. - [Auto Rename Tag](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag) - Automatically rename paired HTML/XML tag. - [Color Highlight](https://marketplace.visualstudio.com/items?itemName=naumovs.color-highlight) - This extension styles CSS/web colors found in your document. - [Dash](https://marketplace.visualstudio.com/items?itemName=deerawan.vscode-dash) - Dash, Zeal, and Velocity integration in Visual Studio Code - [Docker](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker) - This makes it easy to create, manage, and debug containerized applications. - [Draw.io Integration](https://marketplace.visualstudio.com/items?itemName=hediet.vscode-drawio) - This unofficial extension integrates Draw.io (also known as diagrams.net) into VS Code. - [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) - Find and fix problems in your JavaScript code - [Git History](https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory) - View git log, file history, compare branches or commits - [GitHub Markdown Preview](https://marketplace.visualstudio.com/items?itemName=bierner.github-markdown-preview) - Adds styling, markdown checkboxes, footnotes, emoji, and YAML preamble. - [GitLens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens) - Quickly glimpse into whom, why, and when a line or code block was changed. - [Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) - Launch a local development server with a live reload feature for static & dynamic pages. - [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare-pack) - Includes everything you need to start collaboratively editing and debugging in real-time. - [Markdown All in One](https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one) - Markdown keyboard shortcuts, table of contents, auto preview, and more - [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint) - Markdown linting and style checking for Visual Studio Code - [Postman](https://marketplace.visualstudio.com/items?itemName=Postman.postman-for-vscode) - Streamline API development and testing with the power of Postman, directly in your favorite IDE. - [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) - Prettier is an opinionated code formatter. - [Wakatime](https://marketplace.visualstudio.com/items?itemName=WakaTime.vscode-wakatime) - Metrics, insights, and time tracking automatically generated from your programming activity. Note: >You will need to install any VS Code extensions for your Remote - WSL. Extensions already installed locally on VS Code will not automatically be available. [Learn more](https://code.visualstudio.com/docs/remote/wsl#_managing-extensions). ## 🍫 Chocolatey [Chocolatey](https://community.chocolatey.org/) is a command-line package manager like [homebrew](https://brew.sh/) or [APT](https://ubuntu.com/server/docs/package-management), but for Windows. ### Admin Shell Before we start the installation process, I want to cover launching an administrative shell from Windows. There are a few ways to do this: #### Option 1 Right-click on the Windows start menu and select Windows Terminal (Admin):

Right-clicked Windows start menu

Once your terminal loads, click the `˅` icon and open a new PowerShell tab. It should say `Administrator: Windows PowerShell` in the new tab:

Admin PowerShell

#### Option 2 If you have Windows Terminal on your taskbar, Shift + Right-Click on the icon select run as administrator, and then open a new PowerShell tab:

Right click windows terminal icon

#### Option 3 Use the search bar from the Start menu and type in `powershell`. A link to Run as Administrator will display:

Search powershell from the start menu

#### Option 4 Windows Terminal added a new feature where you can launch a PowerShell/Command Prompt profile in an Admin terminal automatically. In the Windows Terminal settings, scroll down to your desired profile and then toggle the `Run this profile as Administrator` switch. Now you can skip all the steps above, and the terminal will always launch as admin.

Automatically launch an admin windows terminal profile

### Installing Chocolatey 1. Open an administrative PowerShell terminal 2. Run the following command: ```ps Get-ExecutionPolicy ``` 3. If it returns `Restricted`, then run one of the following commands: ```ps Set-ExecutionPolicy AllSigned ``` or ```ps Set-ExecutionPolicy Bypass -Scope Process ``` >With PowerShell, you must ensure `Get-ExecutionPolicy` is not Restricted. We suggest using `Bypass` to bypass the policy to get things installed or `AllSigned` for quite a bit more security. 4. Finally, run the following command: ```ps Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) ``` If you don't see any errors, you are ready to use Chocolatey! Type `choco` or `choco -?` now, or see [Getting Started](https://docs.chocolatey.org/en-us/getting-started) for usage instructions. ### Basic Chocolatey Commands We use the `choco` command to run Chocolatey. (_Remember, you must use an administrative shell for it to work._) Install a new package: ```ps choco install filename ``` Remove a package: ```ps choco uninstall filename ``` List all of the installed packages: ```ps choco list ``` Update: ```ps choco upgrade filename ``` or to update everything at once: ```ps choco upgrade all ``` ### Windows Apps Search for available apps on the [Community Package Repository](https://community.chocolatey.org/packages). Here are a few of my favorite (free) apps for productivity and development on Windows: - [Wox](http://www.wox.one/) - A full-featured launcher - [RunJs](https://runjs.app/) - JavaScript and TypeScript playground - [Responsively](https://responsively.app) - A modified web browser that helps in responsive web development. - [Zeal](https://zealdocs.org/) - the Windows version of Dash - [Figma](https://www.figma.com) - A collaborative UI design tool - [draw.io](https://app.diagrams.net) - Flowchart maker and diagram software - [GitHub Desktop](https://desktop.github.com/) - A GUI for Git - [Postman](https://www.postman.com/) - API tools - [Notion](https://www.notion.so/) - Project management and note-taking software - [Obsidian](https://obsidian.md/) - A note-taking app using markdown - [Microsoft PowerToys](https://docs.microsoft.com/en-us/windows/powertoys/?WT.mc_id=twitter-0000-docsmsft) - A set of utilities for power users You can download all these at once with the following command using Chocolatey in an admin shell: ```ps choco install wox runjs responsively zeal figma drawio github-desktop postman notion powertoys obsidian -y ``` ## 🪜 Chrome Extensions These are all available as [Firefox extensions](https://addons.mozilla.org/en-US/firefox/extensions/) as well. - [Axe Accessibility](https://chrome.google.com/webstore/detail/axe-devtools-web-accessib/lhdoppojpmngadmnindnejefpokejbdd) - Accessibility Checker for Developers, Testers, and Designers in Chrome - [ColorZilla](https://chrome.google.com/webstore/detail/colorzilla/bhlhnicpbhignbdhedgjhgdocnmhomnp) - Advanced Eyedropper, Color Picker, Gradient Generator, and other colorful goodies - [daily.dev](https://chrome.google.com/webstore/detail/dailydev-the-homepage-dev/jlmpjdjjbgclbocgajdjefcidcncaied) - Get a feed of the hottest developer news personalized to you. - [JSON Formatter](https://chrome.google.com/webstore/detail/json-formatter/bcjindcccaagfpapjjmafapmmgkkhgoa?hl=en) - Makes JSON easy to read. - [Nimbus Capture](https://chrome.google.com/webstore/detail/nimbus-screenshot-screen/bpconcjcammlapcogcnnelfmaeghhagj) - Screen Capture full Web page or any part. - [React Dev tools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi) - Adds React debugging tools to the Chrome Developer Tools. - [Site Pallette](https://chromewebstore.google.com/detail/site-palette/pekhihjiehdafocefoimckjpbkegknoh?hl=en-US&utm_source=ext_sidebar) - Generate a color palette from any website. - [WhatFont](https://chrome.google.com/webstore/detail/whatfont/jabopobgcpjmedljpbcaablpmlmfcogm) - With this extension, you could inspect web fonts by just hovering on them. ## 🇺🇸 VetsWhoCode Web App Let's get the VWC App installed and running locally. It will be our first step toward making Open-Source contributions to the organization! 1. Clone the Repo Clone the repository from GitHub: ```sh gh repo clone Vets-Who-Code/vets-who-code-app ```

Using git clone

This may take a few minutes. 2. Change Directory Change into the newly cloned directory: ```sh cd vets-who-code-app ```

Changing to the app directory

3. Install Node.js Using `nvm install` will install the version of Node.js required by the VWC app: ```sh nvm install ```

Install node with NVM

4. Install Dependencies `npm install` is how we install React, Next, Bootstrap, and every other piece of tech that the app requires. This will also take a few minutes. ```sh npm install ``` There will be **a lot** of warnings and other messages that display, but this is normal.

Installing dependencies with npm

Installing dependencies with npm continued

5. Run the App Finally, we can launch the app on our local server: ```sh npm run dev ```

Run the vwc app locally

You should be able to view the website locally at [http://localhost:3000/](http://localhost:3000/)]. CTRL + Left-click on the localhost link in your terminal to launch the app in your browser. CTRL + C to close the dev server when you are finished. ## 🐍 Python This section covers setting up a Python development environment in WSL. In the end, you will have a package manager, environment manager, some frameworks, extensions, and more. The first step will be confirming that Python is already installed on your system: ```sh python3 --version ``` A Python version number should be returned. If not, install it with: ```sh sudo apt install python3 ``` ### pip pip is the package manager for Python, similar to npm for JavaScript. Install it using the following: ```sh sudo apt install python3-pip ``` ### venv venv allows you to create virtual environments for your Python projects, helping to prevent versioning conflicts. ```sh sudo apt install python3-venv ``` ### Flask Flask is a web development framework similar to Express for Node.js. It can be installed by using pip: ```sh pip3 install flask ``` ### Django Another popular web development framework is Django. Just as before, install it using pip: ```sh pip3 install django ``` ### JupyterLab JupyterLab is a web-based interactive development environment. It is a powerful tool used in data science, scientific computing, computational journalism, and machine learning. Install it using the following command: ```sh pip3 install jupyterlab ``` JupyterLab can be launched using the `jupyter-lab` command. #### Notebook The next step is to install the Jupyter Notebook. It allows you to create and share documents from Jupyter. ```sh pip3 install notebook ``` The notebook is run by using the `jupyter notebook` command. #### Voilà Voilà allows you to convert a Jupyter Notebook into an interactive dashboard that allows you to share your work with others. ```sh pip3 install voila ``` Launch Voilà using the `voila` command. ### Python VS Code Extensions You will find a ton of Python extensions for VS Code, but here are a few of the more popular ones: - [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python) - The official Python extension. - [Django](https://marketplace.visualstudio.com/items?itemName=batisteo.vscode-django) - Syntax highlighting and snippets for Django. - [Python Indent](https://marketplace.visualstudio.com/items?itemName=KevinRose.vsc-python-indent) - Correct Python indentation. - [Python Environment Manager](https://marketplace.visualstudio.com/items?itemName=donjayamanne.python-environment-manager) - Manage all of your Python environments & packages. - [autoDocstring](https://marketplace.visualstudio.com/items?itemName=njpwerner.autodocstring) - Quickly generate docstrings for Python functions. - [Black Formatter](https://marketplace.visualstudio.com/items?itemName=ms-python.black-formatter) - Code formatter for Python using Black - [AREPL](https://marketplace.visualstudio.com/items?itemName=almenon.arepl) - Automatically evaluates Python code in real-time as you type. - [Python Test Explorer](https://marketplace.visualstudio.com/items?itemName=LittleFoxTeam.vscode-python-test-adapter) - Run your Python tests in the Sidebar of Visual Studio Code. ### PyCharm Instead of using VS Code, another option is to use an IDE made specifically for Python development. JetBrains created one of the best and most widely used ones called PyCharm. There is a free community edition version that can be downloaded [here](https://www.jetbrains.com/pycharm/). ## 💎 Ruby In this section, we'll install Ruby using `rbenv`. Using rbenv will also allow you to install multiple Ruby environments on your machine, using different versions. _This guide continues installation with zsh as the default shell._ 1. Install rbenv ```sh sudo apt install rbenv ``` 2. Follow the instructions to load rbenv in the shell: ```sh rbenv init ``` The output will prompt you with instructions for loading rbenv. In your **.zshrc**, add the following line: ```sh # Loading rbenv automatically eval "$(rbenv init -)" ``` 3. Restart your terminal to update the shell. 4. Before installing Ruby, you'll want to ensure your build environment contains the required tools and libraries: ```sh sudo apt-get install autoconf bison patch build-essential rustc libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libgmp-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev uuid-dev ``` 5. Next, install `ruby-build` as a rbenv plugin, to make sure we don't have any problems with rbenv. ```sh git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build ``` 6. Let's get Ruby installed: Run this command to see which stable versions of Ruby are available: ```sh rbenv install -l ``` Install the most recent stable version, which in this case is v3.1.2: ```sh rbenv install --verbose 3.3.5 ``` This can take a _very_ long time. The `--verbose` flag will show the install progress, otherwise, it will look like it's frozen. _Ruby will be installed in your `~/.rbenv` directory._ 7. Set the global version, so that when you open a new terminal, it will use this version of Ruby. ```sh rbenv global 3.3.5 ``` 8. Close your terminal and open a new session. Check your current version of Ruby: ```sh ruby -v ``` You should see something like this: ```sh ruby 3.3.5 (2024-09-03 revision ef084cc8f4) [x86_64-linux] ``` ### Rails Now that Ruby is installed, you can install Rails. Ruby has its built-in package manager, called RubyGems. This is what you'll use to install Rails. Enter the following to install Rails v7.2.1.2: _The `--no-document` flag speeds up the installation by skipping the gem documentation files._ ```sh gem install rails -v 7.2.1.2 --no-document ``` 1. Next you'll need to install a shim to associate the `rails` command with `rbenv`: ```sh rbenv rehash ``` This command should run automatically after gems are installed 2. Close your terminal and open a new session. Verify Rails was successfully installed: ```sh rails -v ``` You should see this in your terminal: ```sh Rails 7.0.4 ``` ### Ruby VS Code Extensions - [Ruby](https://marketplace.visualstudio.com/items?itemName=rebornix.Ruby) - Official VS Code Ruby extension. - [VSCode Ruby](https://marketplace.visualstudio.com/items?itemName=wingrunr21.vscode-ruby) - Syntax highlighting, snippet, and language configuration support for Ruby. - [Ruby Test Explorer](https://marketplace.visualstudio.com/items?itemName=connorshea.vscode-ruby-test-adapter) - Run your Ruby tests in the Sidebar of Visual Studio Code. - [Rails](https://marketplace.visualstudio.com/items?itemName=bung87.rails) - Ruby on Rails support for Visual Studio Code. - [Ruby Solargraph](https://marketplace.visualstudio.com/items?itemName=castwide.solargraph) - A Ruby gem that provides IntelliSense features through Microsoft's language server protocol. - [Ruby LSP](https://marketplace.visualstudio.com/items?itemName=Shopify.ruby-lsp) - Companion VS Code extension for the Ruby LSP gem. ## Docker This section covers setting docker desktop for Windows. In the end, you will have a docker-daemon, docker-cli, docker-compose, and more. Docker provides the ability to package and run an application in a loosely isolated environment called a container. - [Docker Documentation](https://docs.docker.com/get-started/overview/) ### Docker Installation - Docker uses virtualization to run containers so there are two options to run Docker either via WSL (recommended) or Hyper-V. If you have wsl enabled docker currently by default runs on wsl. - What should you use? [Difference Between Hyper-V and Wsl](https://superuser.com/questions/1561465/docker-on-hyper-v-vs-wsl-2) - If you don't have wsl2 you need to enable Hyper-V [Guide](https://techcommunity.microsoft.com/t5/educator-developer-blog/step-by-step-enabling-hyper-v-for-use-on-windows-11/ba-p/3745905) Again there are two ways you can install docker-desktop on your Windows machine: #### Option 1 Using [Chocolatey](https://community.chocolatey.org/) CLI package manager which we installed earlier. For installation we will need a shell with administrative privileges, we covered how to run Powershell as an administrator while installing Chocolatey. Using any of the options open up a PowerShell. ```sh choco install docker-desktop ```

docker installation via choco

#### Option 2 Direct install via executable available on [docker.com](https://www.docker.com/products/docker-desktop/) Step 1 - Download the executable for docker-desktop.

docker.com docker desktop download page

docker desktop installation screenshot

Step 2 - Install the executable, and choose the appropriate virtualization environment while installing if the option shows up. Step 3 - Done with installation. Sign in with the docker account or skip for the time being.

docker desktop gui screenshot

#### Test Docker CLI Make sure you at least launch docker-desktop once, and let it run in the background. ```sh docker -v ```

docker version command

```sh docker ``` ```sh docker info ```

docker info in cli

You have successfully installed docker-desktop and all other necessary tools docker-cli, docker-compose, and more. ### Docker Basics #### Docker CLI Let's test some of the docker functionalities using the CLI. List all the running containers: ```sh docker ps ``` List all the available images locally: ```sh docker images ls -a ``` Run a container: - p tag for specifying the port - d tag for detaching the shell ```sh docker run -p 8080:80 httpd ```

docker cli run command

The above command will fetch a public image of httpd which is an Apache HTTP server. It then runs it as a Docker container exposing port 80, and making it available to port 8080 of our local machine. You can visit [localhost](http://localhost:8080) and view the content served by this container.

content served on localhost port 8080

Now if you run the `ps` command again it will list out this container.

docker cli list command

Stop the running docker container: ```sh docker stop [container-id] ```

docker cli stop command

#### Additional Docker Resources - Explore [docker-hub](https://hub.docker.com/search?q=) library of all the public docker images. - [What is a Container?](https://docs.docker.com/get-started/#what-is-a-container) - [What is an Image?](https://docs.docker.com/get-started/#what-is-an-image) - [Dockerfile](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/) - [Containerizing an application](https://docs.docker.com/get-started/02_our_app/) - [Docker-compose](https://docs.docker.com/compose/) - [Multi Container Application](https://docs.docker.com/get-started/07_multi_container/) - [Image Building](https://docs.docker.com/get-started/09_image_best/) ## 📚 References - [Set up a WSL development environment](https://docs.microsoft.com/en-us/windows/wsl/setup/environment) - [Microsoft WSL Install Guide](https://docs.microsoft.com/en-us/windows/wsl/install) - [WSL2 Install Guide](https://www.sitepoint.com/wsl2/) - [Install and get started setting up Windows Terminal](https://docs.microsoft.com/en-us/windows/terminal/install) - [Git a Grip](https://dev.to/stephanlamoureux/series/11364) - [Git Credential Manager](https://github.com/GitCredentialManager/git-credential-manager) - [Using Zsh in WSL](http://kevinprogramming.com/using-zsh-in-windows-terminal/) - [Installing Node on WSL](https://docs.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-wsl) - [What is npm? A Node Package Manager Tutorial for Beginners](https://www.freecodecamp.org/news/what-is-npm-a-node-package-manager-tutorial-for-beginners/) - [Chocolatey Install Docs](https://chocolatey.org/install) ================================================ FILE: README_cn.md ================================================

Microsoft Windows Logo

Windows 开发人员设置指南(2022)

[English](./README.md) | [中文](./README_cn.md) - [🔭概述](#概述) - [☑先决条件](#先决条件) - [🐧 WSL](#-wsl-1-2-3) - [安装 WSL 2](#安装-wsl-2) - [用户配置](#用户配置) - [更新 Linux](#更新-linux) - [映射你的 Linux 驱动器](#映射你的-linux-驱动器) - [固定代码目录](#固定代码目录) - [重启 WSL](#重启-wsl) - [👨💻 Windows 终端](#-windows-终端4) - [安装 Windows 终端](#安装-windows-终端) - [终端设置](#终端设置) - [默认配置文件](#默认配置文件) - [开始目录](#开始目录) - [📝 Git 配置](#-git-配置5) - [姓名](#姓名) - [电子邮件](#电子邮件) - [用户名](#用户名) - [😺 GitHub 凭据](#-github-凭据6) - [创建你的个人访问令牌](#创建你的个人访问令牌) - [Git 凭据管理器](#git-凭据管理器) - [存储令牌](#存储令牌) - [💤 Zsh](#-zsh7) - [安装 Zsh](#安装-zsh) - [OhMyZsh](#ohmyzsh) - [cURL](#curl) - [安装 OhMyZsh](#安装-ohmyzsh) - [更多插件](#更多插件) - [zsh-autosuggestions](#zsh-autosuggestions) - [zsh-syntax-highlighting](#zsh-syntax-highlighting) - [📦 Node.js](#-nodejs8) - [NVM](#nvm) - [安装 NVM](#安装-nvm) - [更改node版本](#更改node版本) - [💻 Visual Studio 代码](#-visual-studio-代码) - [安装 VS Code](#安装-vs-code) - [更改默认主题](#更改默认主题) - [远程扩展](#远程扩展) - [更多扩展](#更多扩展) - [🍫Chocolatey](#Chocolatey9) - [管理shell](#管理shell) - [选项 1](#选项-1) - [选项 2](#选项-2) - [选项 3](#选项-3) - [安装 Chocolatey](#安装-chocolatey) - [基本 Chocolatey 命令](#基本-chocolatey-命令) - [Windows 应用程序](#windows-应用程序) - [🪜 Chrome 扩展](#-chrome-扩展) - [🇺🇸 VetsWhoCode Web App](#-vetswhocode-web-app) ## 🔭概述 经过大量的试验和错误,我已经能够拼凑出一个相当不错的 Windows 开发环境。已经有很多指南,但似乎没有一个涵盖整个范围。我试图在这里这样做,而不是深入任何单个主题。我相信这将为大多数用户留下流畅的 Windows 开发人员体验。

Using wox, windows term, ohmyzsh, and vs code

## ☑先决条件 - Windows 10 版本 2004 及更高版本(Build 19041 及更高版本)或 Windows 11[(我是哪个版本?)](https://support.microsoft.com/en-us/topic/628bec99-476a-2c13-5296-9dd081cdd808) - [GitHub](https://github.com)帐户 ## 🐧 WSL [^1] [^2] [^3] 设置 Windows 开发环境的第一个也是最重要的部分是安装 WindowsLinux 子系统(WSL)。我建议坚持使用 Ubuntu,但可以随意尝试尽可能多的发行版。一次安装多个发行版没有问题。 ### 安装 WSL 2 WSL 2 是 WSL 的最新版本,增加了新功能,如全 Linux 内核和全系统调用兼容性。过去安装它需要几个步骤,但我们现在只需要在 PowerShell 或命令提示符中输入以下命令: ```sh wsl --install ``` 此命令执行以下操作: - 启用可选的 WSL 和虚拟机平台组件 - 下载并安装最新的 Linux 内核 - 将 WSL 2 设置为默认值 - 下载并安装 UbuntuLinux 发行版(可能需要重新启动) 使用 `--install` 命令默认为 Ubuntu,仅在尚未安装 WSL 时有效。如果你想更改默认 Linux 发行版,[关注这些文档](https://docs.microsoft.com/en-us/windows/wsl/install#change-the-default-Linux-distribution-installed)。 ### 用户配置 使用 WSL 安装 Linux 发行版的过程完成后,使用开始菜单打开发行版(默认为 Ubuntu)。系统将要求你为 Linux 发行版创建用户名和密码。当你输入新密码时,终端中不会显示任何内容。你的键盘仍在工作!这只是一个安全功能。 - 此用户名和密码特定于你安装的每个单独的 Linux 发行版,与你的 Windows 用户名无关。 - 创建用户名和密码后,该帐户将成为分发的默认用户,并在启动时自动登录。 - 此帐户将被视为 Linux 管理员,能够运行 sudo(Super User Do)管理命令。 - WSL 上运行的每个 Linux 发行版都有自己的 Linux 用户帐户和密码。每次添加发行版、重新安装或重置时,都必须配置 Linux 用户帐户。 ### 更新 Linux 建议你定期更新和升级软件包。在 Ubuntu 或 Debian 中,我们使用 `apt` 包管理器: ```sh sudo apt update && sudo apt upgrade ``` Windows 不会自动更新或升级你的 Linux 发行版。这是大多数 Linux 用户喜欢自己控制的任务。 ### 映射你的 Linux 驱动器 当你打开 Windows 文件资源管理器时,它会显示你的设备和驱动器。我们将添加我们的 Ubuntu 虚拟驱动器作为网络位置以便于访问。 1. 从文件资源管理器打开 `\\wsl$\` 位置:

File explorer search bar

2. 右键单击 Ubuntu 文件夹,然后选择 `Map network drive`:

Mapping network drive

3. 选择你要使用的驱动器号,保留 `Reconnect at sign-in` 选中和 `Connect using different credentials` 未选中,然后单击完成(我的看起来会略有不同,因为它已经完成):

Mapping network drive

4. 最终结果应该如下所示:

File explorer

如果你想从 Linux 终端访问 Windows 文件,它们可以在 `/mnt/` 目录中找到,因此你的 Windows 用户目录将位于 `/mnt/c/Users/username`。 映射 Ubuntu 驱动器后,你可以使用文件资源管理器轻松地将 Windows 文件拖放或复制/粘贴到 Linux 文件系统。 但是,建议将你的项目文件存储在 Linux 文件系统上。这将比从 Windows 访问文件快得多,而且也可能有点错误。 #### 固定代码目录 我的另一个快速提示是在 Ubuntu 中创建一个代码目录,然后将其固定到文件资源管理器左侧的快速访问菜单上。在 Windows 和 Linux 之间快速传输文件时,这会派上用场。 1. 打开文件资源管理器并单击我们创建的 Ubuntu 网络驱动器 2. 选择主目录,然后选择你的用户目录 3. 右键单击并创建一个新文件夹,将其命名为代码或你想要的任何其他内容 4. 将新文件夹拖到左侧,在显示 `Quick access` 的星形图标下方

My code directory

### 重启 WSL 如果由于某种原因 WSL 停止工作,你可以使用 PowerShell/命令提示符中的以下两个命令重新启动它: ```sh wsl.exe --shutdown wsl.exe ``` 如果你回到你的 Linux 壳,一切都应该恢复正常。 ## 👨💻 Windows 终端 [^4] 要启动 Linux 终端,我们目前需要使用开始菜单中的 Ubuntu 图标,或者在 PowerShell/命令提示符中输入 `wsl` 或 `bash` 命令。另一个为我们提供更多功能(如选项卡、拆分视图、主题、透明度和键绑定)的选项是使用 Windows 终端。还有一些其他终端,如[Cmder](https://cmder.net/)、[ConEmu](https://conemu.github.io/)或[Hyper](https://hyper.is/),但根据我的经验,Windows 终端运行得非常好。 ### 安装 Windows 终端 Windows 11 默认带有 Windows 终端,但如果你使用的是 Windows 10,请通过[微软商店](https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?rtc=1&activetab=pivot:overviewtab)下载并安装 Windows 终端。 ### 终端设置 我建议快速设置的几件事是默认配置文件和你的起始主目录。这些设置使启动 Windows 终端将直接打开到我们用户主目录中的 WSL。 #### 默认配置文件 Windows 终端默认启动时会打开 PowerShell 或命令提示符 shell,以下是如何将其切换到 WSL: 1. 从 Windows 终端中选择 `˅` 图标并转到设置菜单:

Windows terminal settings

2. 在启动部分,你将找到默认配置文件下拉列表,选择 Ubuntu。在它下面,选择 Windows 终端作为默认终端应用程序:

Default shell profile

#### 开始目录 默认的 Ubuntu 终端将打开到根目录。为了更快地找到你的文件,我们可以将其打开到你的主目录中。 1. 在设置菜单的配置文件部分下,单击 Ubuntu 2. 在常规选项卡上,你将找到一个起始目录输入 3. 输入以下将“用户名”替换为你的 Ubuntu 用户名: 4. 你可以不选中 `Use parent process directory` 框 5. 如果它仍在打开你的 `/` 目录,请将位于 `Starting directory` 输入框正上方的 `Command line` 设置更改为以下内容: `wsl.exe-d Ubuntu`

Starting directory in Ubuntu terminal

还有更多设置需要探索,还有一个 JSON 文件可以编辑以进行更高级的自定义。 查看[this guide](https://www.ubuntupit.com/best-windows-terminal-themes-and-color-schemes/)了解一些流行的 Windows 终端主题以及如何安装它们。 ## 📝 Git 配置 [^5] Git 应该预装在大多数(如果不是所有的话)WSLLinux 发行版上。为确保你拥有最新版本,请在基于 Ubuntu 或 Debian 的发行版中使用以下命令: ```sh sudo apt install git ``` ### 姓名 要设置你的 Git 配置文件,请打开 WSL 命令行并使用此命令设置你的姓名(将“你的姓名”替换为你的首选用户名): ```sh git config --global user.name "Your Name" ``` ### 电子邮件 使用此命令设置你的电子邮件(将“youremail@domain.com”替换为你喜欢的电子邮件): ```sh git config --global user.email "youremail@domain.com" ``` ### 用户名 最后,添加你的 GitHub 用户名以将其链接到 git(区分大小写!): ```sh git config --global user.username "GitHub username" ``` 确保你输入的是 `user.username` 而不是 `user.name`,否则你将覆盖你的姓名并且你将无法正确同步到你的 GitHub 帐户。 你可以通过键入 `git config--global user.name` 等来仔细检查你的任何设置。要进行任何更改,只需再次键入必要的命令,如上例所示。 ## 😺 GitHub 凭据 [^6] ### 创建你的个人访问令牌 GitHub 已删除在远程存储库中工作时使用传统密码的功能。你现在需要创建个人访问令牌。 >当使用[GitHub API](https://docs.github.com/en/rest/overview/other-authentication-methods#via-oauth-and-personal-access-tokens)或[命令行](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#using-a-token-on-the-command-line)时,个人访问令牌(PAT)是使用密码对 GitHub 进行身份验证的替代方案。 按照[these docs](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)获取有关创建个人令牌的分步说明。 ### Git 凭据管理器 一旦你第一次输入令牌,它就可以通过[Git 凭据管理器(GCM)](https://github.com/GitCredentialManager/git-credential-manager)存储,因此你不必每次都对自己进行身份验证。 你可以同时在 WSL 和 Windows 中安装 Git。[适用于 Windows 的 Git](https://gitforwindows.org/)包括 GCM,是安装它的首选方式。

Windows Git Installer Menu

你还可以下载[Windows 的最新安装程序](https://github.com/GitCredentialManager/git-credential-manager/releases/latest)来安装 GCM 独立版。 ### 存储令牌 安装 Git Credential Manager 后,你可以将其设置为与 WSL 一起使用。打开你的 WSL 终端并输入以下命令: ```sh git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/libexec/git-core/git-credential-manager-core.exe" ``` ## 💤 Zsh [^7] Z shell 的工作原理几乎与默认 Linux 安装中的标准 BASH shell 相同。它的不同之处在于它对插件和主题的支持,以及一些额外的功能,如拼写更正和递归路径扩展。是时候把 BASH 扔进垃圾桶了! ### 安装 Zsh ```sh sudo apt install zsh ``` 安装后,键入 `zsh` 命令。Zsh 会要求你选择一些配置。我们稍后将在安装 oh-my-zsh 时执行此操作,因此选择选项 0 以创建配置文件并防止再次显示此消息。 ### OhMyZsh 到目前为止,最流行的插件框架是[OhMyZsh](https://ohmyz.sh/)。它预装了大量插件、主题、助手等。它肯定有助于提高生产力,但更重要的是,它看起来😎很酷。 ### cURL 首先,我们需要确保安装了[cURL](https://curl.se/)。“客户端 URL”的缩写,它是一种从命令行传输数据的方法,这就是我们下载 OhMyZsh 的方式。 ```sh sudo apt install curl ``` ### 安装 OhMyZsh 在你的终端中输入以下命令以安装 OhMyZsh: ```sh sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" ``` 就这样!你现在应该在主目录中看到一个 `.oh-my-zsh` 目录。要更改插件和主题,你需要编辑你的 `.zshrc` 文件,也可以在你的主目录中找到。这是与 OhMyZsh 捆绑在一起的所有[themes](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes)和[plugins](https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins)的列表。 ### 更多插件 #### [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions) zsh 的自动建议,它根据历史记录和完成情况在你键入时建议命令。 1. 将此存储库克隆到 `$ZSH_CUSTOM/plugins`(默认情况下 `~/.oh-my-zsh/custom/plugins`) ```sh git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions ``` 2. 将插件添加到要加载的 Oh My Zsh 的插件列表中(在 `~/.zshrc` 中): ```sh plugins=(git zsh-autosuggestions) ``` 3. 开始新的终端会话。 #### [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting) 此包为 shell zsh 提供语法高亮显示。当命令在 zsh 提示符下输入到交互式终端时,它可以高亮显示命令。这有助于在运行命令之前查看命令,特别是在捕获语法错误方面。 1. 在 oh-my-zsh 的 plugins 目录中克隆此存储库: ```sh git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting ``` 2. 激活 `~/.zshrc` 中的插件: ```sh plugins=(git zsh-autosuggestions zsh-syntax-highlighting) ``` 3. 开始新的终端会话。 ## 📦 Node.js [^8] Node.js 是一个 JavaScript 运行时环境,它在 Web 浏览器之外执行 JavaScript 代码。 ### NVM 你可能需要根据你正在处理的不同项目的需求在 Node.js 的多个版本之间切换。Node Version Manager 允许你通过命令行快速安装和使用不同版本的节点。 #### 安装 NVM 1. 打开你的 Ubuntu 命令行并使用以下命令安装 nvm: ```sh curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash ``` 要验证安装,请输入: `command-v nvm`。这应该返回“nvm”,如果你收到“未找到命令”或根本没有响应,请关闭当前终端,重新打开它,然后重试。 2. 列出当前安装了哪些版本的 Node(此时应该没有): ```sh nvm ls ```

Ubuntu terminal displaying node not installed

3. 安装当前和稳定的 LTS 版本的 Node.js. 安装 Node.js 的当前稳定 LTS 版本(推荐用于生产应用): ```sh nvm install --lts ``` 安装当前版本的 Node.js(用于测试最新的 Node.js 功能和改进,但更有可能出现问题): ```sh nvm install node ``` 4. 列出安装了哪些版本的 Node: ```sh nvm ls ``` 现在你应该看到列出了你刚刚安装的两个版本。

Ubuntu terminal displaying node installed

5. 验证是否安装了 Node.js 和当前版本: ```sh node --version ``` 然后验证你是否也安装了 npm: ```sh npm --version ``` #### 更改node版本 使用以下命令更改要用于任何给定项目的 Node 版本: 要切换到当前版本: ```sh nvm use node ``` 要切换到 LTS 版本: ```sh nvm use --lts ``` 你还可以将特定编号用于你安装的任何其他版本: ```sh nvm use v8.2.1. ``` 要列出所有可用的 Node.js 版本,请使用命令: `nvm ls-remote`。 ## 💻 Visual Studio 代码 有许多令人惊叹的代码编辑器可免费使用,但 Visual Studio Code 已成为事实上的标准和我个人的最爱。 ### 安装 VS Code VS Code 在 Windows、macOS 和 Linux 上可用。你可以下载最新的 Windows 安装程序[here](https://code.visualstudio.com/)。我建议使用稳定版本。 ### 更改默认主题 WSL2 shell 可以通过按下 `Ctrl` + `Shift` + `P` 并键入/选择终端:选择默认配置文件,然后选择 zsh:

VSCode default shell

VSCode default shell

### 远程扩展 在 VS Code 上安装[远程-WSL](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl)扩展。 >这允许你使用 WSL 作为集成开发环境,并为你处理兼容性和路径。[Learn more](https://code.visualstudio.com/docs/remote/remote-overview)。 此扩展还允许你使用 `code` 命令直接从你的 WSL 终端启动 VS Code。 如果我在我的存储库的根目录中,我会使用 `code.` 在 VS Code 中启动整个目录。 ```sh cd my-project code . ``` ### 更多扩展 VS Code 可用的扩展数量可能是压倒性的,这里有一些我使用最多的扩展。 - [实时服务器](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer)-启动具有静态和动态页面实时重新加载功能的本地开发服务器。 - [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare-pack)-包括开始实时协作编辑和调试所需的一切。 - [GitLens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens)-快速了解谁、为什么以及何时更改了行或代码块。 - [Git 历史](https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory)-查看 git 日志、文件历史记录、比较分支或提交 - [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)-漂亮是一个固执己见的代码格式化程序。 - [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)-查找并修复 JavaScript 代码中的问题 - [颜色亮点](https://marketplace.visualstudio.com/items?itemName=naumovs.color-highlight)-此扩展设置文档中的 CSS/Web 颜色。 - [降价所有在一个](https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one)-Markdown 键盘快捷键、目录、自动预览等 - [MarkDownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint)-Visual Studio Code 的 Markdown 加注和样式检查 - [GitHub Markdown 预览](https://marketplace.visualstudio.com/items?itemName=bierner.github-markdown-preview)-添加样式、降价复选框、脚注、表情符号和 YAML 序言。 - [Wakatime](https://marketplace.visualstudio.com/items?itemName=WakaTime.vscode-wakatime)-从你的编程活动自动生成的指标、见解和时间跟踪。 - [Dash](https://marketplace.visualstudio.com/items?itemName=deerawan.vscode-dash)-Visual Studio Code 中的破折号、热情和速度集成 - [Draw.io 整合](https://marketplace.visualstudio.com/items?itemName=hediet.vscode-drawio)-这个非官方扩展将 Draw.io(也称为 diagrams.net)集成到 VS Code 中。 - [Docker](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker)-可以轻松创建、管理和调试容器化应用程序。 - [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python)-IntelliSense、Lting、调试、Jupyter Notebook、重构、单元测试等。 - [VetsWhoCode 扩展包](https://marketplace.visualstudio.com/items?itemName=VetsWhoCode.vetswhocode-extension-pack&ssr=false#review-details)-在 #VetsWhoCode 学习 javascript 的新退伍军人扩展包 注意:>你需要为 Remote-WSL 安装任何 VS Code 扩展。已在 VS Code 上本地安装的扩展将不会自动可用。[Learn more](https://code.visualstudio.com/docs/remote/wsl#_managing-extensions)。 ## 🍫Chocolatey [^9] Chocolatey 是一个类似于[homebrew](https://brew.sh/)的包管理器,但适用于 Windows。 ### 管理shell 在我们开始安装过程之前,我想介绍一下从 windows 启动管理 shell。有几种方法可以做到这一点: #### 选项 1 右键单击 Windows 开始菜单并选择 Windows 终端(管理):

Right clicked Windows start menu

终端加载后,单击 `˅` 图标并打开一个新的 PowerShell 选项卡。它应该在新选项卡中显示 `Administrator: Windows PowerShell`:

Admin PowerShell

#### 选项 2 如果任务栏上有 Windows 终端,图标上的 `Shift` + `Right-Click` 并选择以管理员身份运行,然后打开一个新的 PowerShell 选项卡:

Right click windows terminal icon

#### 选项 3 使用开始菜单中的搜索栏并输入 `powershell`。以管理员身份运行的链接将显示:

Search powershell from the start menu

### 安装 Chocolatey 1. 打开管理 PowerShell 终端 2. 运行 `Get-ExecutionPolicy`。 3. 如果返回 `Restricted`,则运行 `Set-ExecutionPolicy AllSigned` 或 `Set-ExecutionPolicy Bypass-Scope Process`。 >使用 PowerShell,你必须确保 Get-ExecutionPolicy 不受限制。我们建议使用 Bypass 绕过策略以安装或 AllSigned 以提高安全性。 4. 现在运行以下命令: ```sh Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) ``` 5. 如果你没有看到任何错误,你就可以使用 Chocolatey 了!现在键入 `choco` 或 `choco-?`,或参见[开始使用](https://docs.chocolatey.org/en-us/getting-started)了解使用说明。 ### 基本 Chocolatey 命令 我们使用 `choco` 命令来使用 chocolatey。请记住,你必须使用管理 shell 才能使其工作。在[社区包存储库](https://community.chocolatey.org/packages)上搜索可用的应用程序。 安装一个新包: ```ps choco install filename ``` 删除包: ```ps choco uninstall filename ``` 列出所有已安装的软件包: ```ps choco list ``` 更新: ```ps choco upgrade filename ``` 或一次更新所有内容: ```ps choco upgrade all ``` ### Windows 应用程序 以下是一些我最喜欢的(免费)应用程序,用于在 Windows 上提高生产力和开发: - [Wox](http://www.wox.one/)-功能齐全的启动器 - [RunJs](https://runjs.app/)-JavaScript 和 TypeScript 游乐场 - [响应地](https://responsively.app)-一个修改后的 Web 浏览器,有助于响应式 Web 开发。 - [Zeal](https://zealdocs.org/)-Dash 的 Windows 版本 - [Figma](https://www.figma.com)-协作 UI 设计工具 - [draw.io](https://app.diagrams.net)-流程图制作器和图表软件 - [GitHub 桌面](https://desktop.github.com/)-Git 的 GUI - [Postman](https://www.postman.com/)-API 工具 - [Notion](https://www.notion.so/)-项目管理和笔记软件 - [微软 PowerToys](https://docs.microsoft.com/en-us/windows/powertoys/?WT.mc_id=twitter-0000-docsmsft)-一组高级用户实用程序 你可以在 admin shell 中使用 chocolatey 使用以下命令一次下载所有这些: ```sh choco install wox runjs responsively zeal figma drawio github-desktop postman notion powertoys -y ``` ## 🪜 Chrome 扩展 这些都以[Firefox 扩展](https://addons.mozilla.org/en-US/firefox/extensions/)的形式提供。 - [React Dev tools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi)-将 React 调试工具添加到 ChromeDeveloper Tools。 - [ColorZilla](https://chrome.google.com/webstore/detail/colorzilla/bhlhnicpbhignbdhedgjhgdocnmhomnp)-高级吸管、颜色选择器、渐变生成器和其他丰富多彩的好东西 - [Axe Accessibility](https://chrome.google.com/webstore/detail/axe-devtools-web-accessib/lhdoppojpmngadmnindnejefpokejbdd)-Chrome 中开发人员、测试人员和设计人员的可访问性检查器 - [daily.dev](https://chrome.google.com/webstore/detail/dailydev-the-homepage-dev/jlmpjdjjbgclbocgajdjefcidcncaied)-获取为你个性化的最热门开发者新闻的提要。 - [Nimbus Capture](https://chrome.google.com/webstore/detail/nimbus-screenshot-screen/bpconcjcammlapcogcnnelfmaeghhagj)-屏幕捕获完整网页或任何部分。 - [WhatFont](https://chrome.google.com/webstore/detail/whatfont/jabopobgcpjmedljpbcaablpmlmfcogm)-使用此扩展,你可以通过将鼠标悬停在 Web 字体上来检查它们。 - [JSON Formatter](https://chrome.google.com/webstore/detail/json-formatter/bcjindcccaagfpapjjmafapmmgkkhgoa?hl=en)-使 JSON 易于阅读。 ## 🇺🇸 VetsWhoCode Web App 让我们在本地安装并运行 VWC 应用程序。这将是我们为组织做出开源贡献的第一步! 1. 克隆回购 使用 `git clone` 从 GitHub 下载存储库: ```sh git clone https://github.com/Vets-Who-Code/vets-who-code-app.git ```

Using git clone

这需要几分钟。 2. 更改目录 切换到新克隆的目录: ```sh cd vets-who-code-app ```

Changing to the app directory

3. 安装 Node.js 使用 `nvm install` 将安装 VWC 应用程序所需的 Node.js 版本: ```sh nvm install ```

Install node with NVM

4. 安装依赖项 `npm install` 是我们安装 React、Next、Bootstrap 和应用程序所需的所有其他技术的方式。这也需要几分钟。 ```sh npm install ``` 会显示**一大堆**的警告和其他消息,但这是正常的。

Installing dependencies with npm

Installing dependencies with npm continued

5. 环境变量 环境变量保存秘密 API 密钥,并且需要通过连接到 Contentful API 来运行博客。 我们可以创建一个默认的. env 文件,该文件将在本地运行博客时使用模拟数据。从 vets-wh-code-app 目录的根目录使用以下命令: ```sh cp .env.example .env ```

Creating the .env file

6. 运行应用程序 最后,我们可以在本地服务器上启动应用程序: ```sh npm run dev ```

Run the vwc app locally

你应该能够在本地查看网站,网址为http://localhost:3000/. `CTRL` + `Left-Click` 在终端的 localhost 链接上启动浏览器中的应用程序。 `CTRL` + `C` 完成后关闭开发服务器。 ## ➕其他环境 我们可以使用更多的语言和工具。如果你对 JavaScript 和 Web 开发以外的内容感兴趣,请查看以下指南,以将你的开发环境提升到一个新的水平。
🛳 Docker
💎Ruby ### Ruby ### Rails
🐍 Python ### Windows 上的 Python 开发 >以下是分步指南,帮助你开始在 Windows 上使用 Python 进行 Web 开发,使用 Windows 子系统 Linux(WSL)。 - [开始在 Windows 上使用 Python 进行 Web 开发](https://docs.microsoft.com/en-us/windows/python/web-frameworks)
⚙Rust
🦡Go
® R ### RStudio Server >RStudio Server 使你能够为在远程 Linux 服务器上运行的 R 版本提供基于浏览器的界面,将 RStudio IDE 的强大功能和生产力带到基于服务器的 R 部署中。 - [在 Windows WSL2 中使用 RStudio Server](https://support.rstudio.com/hc/en-us/articles/360049776974-Using-RStudio-Server-in-Windows-WSL2)
🅿 PHP ### PHP7 >安装 Apache、MySQL 和 PHP 为了创建 LAMP 堆栈的基本结构(Linux、Apache、MySQL、PHP)。 - [在 WSL 2 上安装和配置功能齐全的 Web 服务器](https://needlify.com/post/install-and-configure-a-fully-functionnal-web-server-on-wsl-2-b1aa0954) ### PHP8 >这篇文章是关于 Windows PHP 8 Web 开发的设置。这主要是为了 Laravel 开发。 - [Windows PHP8 开发设置与 WSL2](https://joshpress.net/blog/wsl-debian-php8)
🥅. NET
💾Databases ### 安装数据库 >本分步指南将帮助你开始将 WSL 中的项目连接到数据库。开始使用 MySQL、PostgreSQL、MongoDB、Redis、MicrosoftSQLServer 或 SQLite。 - [开始使用 Windows 子系统上的数据库 Linux](https://docs.microsoft.com/en-us/windows/wsl/tutorials/wsl-database)
[^1]:[设置 WSL 开发环境](https://docs.microsoft.com/en-us/windows/wsl/setup/environment) [^2]:[Microsoft WSL 安装指南](https://docs.microsoft.com/en-us/windows/wsl/install) [^3]:[WSL2 安装指南](https://www.sitepoint.com/wsl2/) [^4]:[安装并开始设置 Windows 终端](https://docs.microsoft.com/en-us/windows/terminal/install) [^5]:[Git a Grip](https://dev.to/stephanlamoureux/series/11364) [^6]:[Git 凭据管理器](https://github.com/GitCredentialManager/git-credential-manager) [^7]:[在 WSL 中使用 Zsh](http://kevinprogramming.com/using-zsh-in-windows-terminal/) [^8]:[在 WSL 上安装node](https://docs.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-wsl) [^9]:[Chocolatey 安装文档](https://chocolatey.org/install)