程序员的 Windows 参考手册

Windows Manual For Programmers

Chocolatey

The Package Manager for Windows

Official Site: https://chocolatey.org/install

# Administrator Powershell Run
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'))

# check install
choco

Proxy

Install

choco install clash-for-windows

Config

Buy air plane

Git

Download Link : https://git-scm.com/download

Install

Run Installer.

Config

# check version
git --version

# commit info
git config --global user.email "myemail@example.com"
git config --global user.name "My Name"

# custom git log info
# https://www.liaoxuefeng.com/wiki/896043488029600/898732837407424
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

Usage

Git command list (Chinese): https://www.ruanyifeng.com/blog/2015/12/git-cheat-sheet.html

# repo
git init
git clone <remote link>

# show info
git status
git log

##### commit #####
git add .
git add *
git commit -am "commit message"
git pull
git push

##### branch #####
# list all local and remote branchs
git branch -a
# list remote branch links
git remote -v
# switch to <brach-name>
git checkout <brach-name>
# create and switch to <branch-name>
git checkout -b <branch-name>
# delete <branch-name>
git branch -d <branch-name>
# delete remote <branch-name>
git push origin --delete <branch-name>

##### tag #####
# list tags
git tag
# add <tag-name> for current commit
git tag <tag-name>
# push <tag> to <remote>
git push <remote> <tag>
# push all tags
git push <remote> --tags

Github CLI

  • Download Installer: https://cli.github.com/

  • Login

gh auth login
  • Generate token at: https://github.com/settings/tokens

Markdown

Typora

Official Site: https://typora.io

  • Purchase: $14.99, ¥89
  • Preferences
  • Add Themes
  • Typora plugin: Typora plugins and feature enhancement tools.

Mark Text

Github:https://github.com/marktext/marktext

  • Open Source And Free

Oh My Posh

Official Site: https://ohmyposh.dev/

Install

# may not work
winget install JanDeDobbeleer.OhMyPosh -s winget
# quickly
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://ohmyposh.dev/install.ps1'))

Config

# Document: https://ohmyposh.dev/docs/installation/prompt
# create $PROFILE file if not exist
New-Item -Path $PROFILE -Type File -Force

# Solve PowerShell blocks running local scripts
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine

# edit $PROFILE
notepad $PROFILE

add config by using the ys theme

# in $PROFILE
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/ys.omp.json" | Invoke-Expression

Font

Install Nerd Fonts (Support icons for some themes). Download fonts at: https://www.nerdfonts.com/font-downloads, For Example JetBrainsMono Nerd Font.

Config terminal font. This can be easily done by modifying the Windows Terminal settings (default shortcut: CTRL + SHIFT + ,). In your settings.json file, add the font.face attribute under the defaults attribute in profiles:

{
    "profiles": {
        "defaults": {
            "font": {
                "face": "JetBrainsMono Nerd Font"
            }
        }
    }
}

Useful tools

PSReadLine: zsh-autosuggestion alternative for powershell

Github: https://github.com/PowerShell/PSReadLine

Install from PowerShellGallery

# get posh version
Get-Host

# install the latest PowerShellGet
Install-Module -Name PowerShellGet -Force

# After installing PowerShellGet, you can get the latest prerelease version of PSReadLine by running
Install-Module PSReadLine -AllowPrerelease -Force

Add Config: notepad $PROFILE

# PSReadLine
Import-Module PSReadLine
# Enable Prediction History
Set-PSReadLineOption -PredictionSource History
# Advanced Autocompletion for arrow keys
Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward

zoxide: zoxide is a smarter cd command, inspired by z and autojump.

Github: https://github.com/ajeetdsouza/zoxide

Install:

# not work for me
winget install ajeetdsouza.zoxide

# I use choco
choco install zoxide

Add Config: notepad $PROFILE

# zoxide
Invoke-Expression (& { (zoxide init powershell | Out-String) })

Windows Terminal Hotkeys

OperationHotkey
CopyCtrl + Shift + C
PastCtrl + Shift + V

VSCode

Official Site: https://code.visualstudio.com/

Install

  • Option1: Download Installer from official site.
  • Option2: Install with Chocolatey
# vscode
choco install vscode
# vscodium
choco install vscodium

Preferences

  • Theme: One Dark Pro
  • Icons: Material icon theme
  • Font: JetBrainsMono Nerd Font
  • Auto Save
  • Change Hotkey: Format Document: Shift+Alt+F ---> Alt+F

Codeium

Codeium: A free AI powered toolkit for developers

Official Site: https://codeium.com/

  • Register an account
  • Download extension
  • Login

VSCodium

VSCodium is a community-driven, freely-licensed binary distribution of Microsoft’s editor VS Code.

Microsoft’s vscode source code is open source (MIT-licensed), but the product available for download (Visual Studio Code) is licensed under this not-FLOSS license and contains telemetry/tracking. According to this comment from a Visual Studio Code maintainer.

VSCodium Site: https://vscodium.com/

Warning: VSCodium can not use code command.

Hotkey

Hotkeys May Change due to extension or customizing.

OperationHotkey
Comment/UncommentCtrl + /
Multiline CommentAlt + Shift + A
Copy LineCtrl + L
Move Line Up/DownAlt + up/down
Copy line to Up/DownShift + Alt + up/down
Delete lineCtrl + X
Add / Reduce IndentCtrl + ]/[
New Line at Any PositionCtrl + Enter
Rename VariableCtrl + D (N times)
Format DocumentShift + Alt + F (Alt + F)
Goto File Head/EndCtrl + Home/Ctrl + End
Switch TabCtrl + Tab
Show all symbolsCtrl +Shift + O
Multi CursorAlt + Left Click
Multi CursorCtrl + Alt + Up/Down
Block SelectShift + Alt + Left Drag

Python

Python Official Site: https://www.python.org/downloads/

Install

  • Option1: Download from official site and run installer.
  • Option2: Install with Chocolatey
choco install python

Config

PyPI tuna mirror:

# once
pip install scrapy -i https://pypi.tuna.tsinghua.edu.cn/simple some-package

# set as default
python -m pip install --upgrade pip
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

VSCode Extension

  • Python
  • Black formatter
  • Pylance

conda

👉 conda (miniconda)

Official Site: https://docs.anaconda.com/free/miniconda/miniconda-install/

tuna: https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/

👉 Config

tuna: https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/

edit or create .condarc 。Windows can run conda config --set show_channel_urls yes to generate .condarc then change it:

channels:
  - defaults
show_channel_urls: true
default_channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  deepmodeling: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/

👉 Usage:

# create a environment with specified python version and packages
conda create -n myenv python=3.9 numpy=1.23.5 astropy
# activate the environment:
conda activate myenv

# list envs
conda env list

# export all packages in myenv environment
conda activate myenv
conda env export > myenv.yml

# create a new environment from a myenv.yml
conda env create -f myenv.yml

👉 Windows Terminal:

Add miniconda prompt to windows terminal:

{
  "altGrAliasing": true,
  "antialiasingMode": "grayscale",
  "closeOnExit": "automatic",
  "colorScheme": "Campbell",
  "commandline": "%windir%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -ExecutionPolicy ByPass -NoExit -Command \"& 'C:\\Users\\zuiai\\miniconda3\\shell\\condabin\\conda-hook.ps1' ; conda activate 'C:\\Users\\zuiai\\miniconda3' \"",
  "cursorShape": "bar",
  "font": {
    "size": 12
  },
  "guid": "{3ba1b1d8-9de1-41b7-bb7a-f7903c2e68d6}",
  "hidden": false,
  "historySize": 9001,
  "icon": "ms-appx:///ProfileIcons/{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.png",
  "name": "MiniConda3",
  "padding": "8, 8, 8, 8",
  "snapOnInput": true,
  "startingDirectory": "%USERPROFILE%\\Desktop",
  "useAcrylic": false
}

Docker

Official Site: https://www.docker.com/products/docker-desktop/

Download Link: https://docs.docker.com/desktop/install/windows-install/

Docker Hub:https://hub.docker.com/

Setup WSL 2

Documents:

https://docs.docker.com/desktop/wsl/

https://learn.microsoft.com/en-us/windows/wsl/install

  • Installed the WSL 2 feature on Windows. Search At Start: Turn Windows features on and off, Check both:
Virtual Machine Platform
Windows Subsystem for Linux
  • Update WSL
# install update
wsl --update

Download and install the latest package: WSL2 Linux kernel update package for x64 machines.

  • Install Linux distros.
# list installed Linux distributions and check the version of WSL
wsl -l -v

# install update
wsl --update

# list available distros
wsl -l -o
# install a distro
wsl --install -d <distro name>
# set default distr
wsl --set-default <distro name>

# upgrade the Linux distro to v2
wsl.exe --set-version <distro name> 2
# set v2 as the default version for future installations
wsl.exe --set-default-version 2
  • Set up your Linux user info

Once you have installed WSL, you will need to create a user account and password for your newly installed Linux distribution.

Just run your linux distro from start menu.

Install

Documents:

https://docs.docker.com/desktop/install/windows-install/

https://docs.docker.com/desktop/wsl/

Download and install the latest version of [Docker Desktop for Windows](https://desktop.docker.com/win/main/amd64/Docker Desktop Installer.exe).

Config

Change Mirrors: Settings—Docker Engine

{
  "builder": {
    "gc": {
      "defaultKeepStorage": "20GB",
      "enabled": true
    }
  },
  "experimental": false,
  "registry-mirrors": [
    "https://mirror.ccs.tencentyun.com/"
  ]
}

Possible Error

Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x8004032d
Error: 0x8004032d (null)
Press any key to continue...

Solution: Enable Virtual Machine Platform Windows Feature.

Windows Hotkeys

Windows 11 New Features

OperationHotkey
Open Snap LayoutWin + Z
Open Microsoft CopilotWin + C

Document Edit

OperationHotkey
CutCtrl + X
CopyCtrl + C
PasteCtrl + V
Clipboard HistoryWin + V
UndoCtrl + Z
RedoCtrl + Y
BoldCtrl + B
ItalicCtrl + I
UnderlineCtrl + U
Move cursor to Head of lineHome
Move cursor to End of lineEnd
Move cursor to head of next wordCtrl + →
Move cursor to head of previous wordCtrl + ←

Window and Desktop

OperationHotkey
Switch between AppsAlt + Tab
Quit AppAlt + F4
Refresh AppCtrl + R
Hide/Show DesktopWin + D
Lock DesktopWin + L
Switch Input MethodWin + Space
Open Function MenuWin + X
Print ScreenPrtScn
Full ScreenF11

Virtual Desktop

OperationHotkey
Open Task ViewWin + Tab
Add Virtual DesktopWin + Ctrl + D
Switch between Virtual DesktopWin + Ctrl + arrow
Close current Virtual DesktopWin + Ctrl + F4

File Browser

OperationHotkey
Open File BrowserWin + E
RenameF2
Create New FolderCtrl + Shift + N
Delete to Recycle BinDel
Delete ForeverShift + Del
Open Classic ContextShift + RC

Task Bar

OperationHotkey
Open Start MenuWin / Ctrl + ESC
Open / Hide nth App in Task BarWin + [N]
Run as AdministratorCtrl + Shift + LC

Browser

OperationHotkey
FindCtrl + F
Edit UrlAlt + D
Open HistoryCtrl + H
New WindowCtrl + N
New TabCtrl + T
Close Current TabCtrl + W
Recycle TabCtrl + Tab
Print Current pageCtrl + P
ReloadCtrl + R / F5
View SourceF12
ScaleCtrl + Mouse Scroll

Game

OperationHotkey
Open Game ToolsWin + G
Game ShortcutWin + Alt + PrtScn
Game RecordWin + Alt + R
  • 12
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
### 回答1: Windows API参考手册Windows系统编程的重要资料,可以帮助开发人员了解和使用Windows系统提供的各种函数、结构体和常量等编程接口。在实际编程中,需要经常查阅Windows API参考手册,以便快速找到相关编程接口的使用方法和参数等详细信息。Windows API参考手册的下载方式很多,可以从Microsoft官网下载最新的版本。同时,国内也有许多网站提供Windows API参考手册的下载,如:CSDN、博客园等知名技术博客网站。在下载之前,需要注意版本的选择和适用范围,以免出现不必要的错误和问题。Windows API参考手册虽然对于程序员来说比较晦涩难懂,但是掌握了Windows API参考手册的使用方法,可以帮助程序员更加高效地进行Windows开发,从而提高开发效率和质量。 ### 回答2: WindowsAPI是Windows操作系统的应用程序编程接口,也是Windows应用程序开发的基础之一。为了能够更好的了解WindowsAPI提供的接口和函数,我们需要下载参考手册进行学习和查询。 在下载WindowsAPI参考手册之前,我们需要明确需要下载的文档版本以及所需的语言版本。在Microsoft官方网站上,我们可以下载各种版本的参考手册,包括Windows 10、Windows 8.1、Windows 7以及Windows Server等版本的文档。此外,还可以选择不同语言版本的文档,包括英语、中文、法语、德语、意大利语等。 下载WindowsAPI参考手册可以通过以下几个步骤来完成:首先,在Microsoft官方网站上搜索需要下载的参考手册;其次,在搜索结果中选择并下载需要的文档版本和语言版本;最后,将文档解压并打开即可。 通过WindowsAPI参考手册的学习和查询,我们可以更好地了解Windows操作系统提供的各种系统接口和函数,以及如何使用它们来开发应用程序。因此,对于Windows应用程序开发者而言,下载和使用WindowsAPI参考手册是非常重要的。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值