Windows 开发工具配置

前言

博主有时需要兼顾游戏与办公等, 并且由于深度学习, 显卡配置 N卡, 因此配置WINDOWS开发美化环境.

SCOOP 配置

如果使用过 MACOS 的 brew 包管理系统, 这个相当于 Windows 的 brew 管理系统.

  • 官方安装文档: Scoop

设定路径

Scoop默认是安装在C盘中用户主目录下的,可以在开始前设定好scoop的安装目录(请在以管理员身份运行的Powershell中执行以下命令):

# 用户模式
[environment]::setEnvironmentVariable('SCOOP','C:\Scoop','Machine') 
$env:SCOOP='C:\Scoop'
# 全局模式, 安装时使用 -g
[environment]::setEnvironmentVariable('SCOOP_GLOBAL','C:\GlobalScoop','Machine')
$env:SCOOP_GLOBAL='C:\GlobalScoopApps'

安装

通过如下命令, 即可进行 Scoop 的安装:

# 配置执行策略 (Powershell)
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
# or shorter
iwr -useb get.scoop.sh | iex

一般而言, 用户可以自行添加自己的仓库, 博主提供常见的几个仓库:

# 安装 git(会自动安装 7zip)
scoop install git
# 如下命令, 可能要求安装程序 git
scoop bucket add extras
scoop bucket add versions
## 第三方库: 包含微信等
scoop bucket add dorado
## 第三方库: 包含字体等
scoop bucket add nerd-fonts
scoop update

设置代理

针对Scoop很多时候需要从 github 进行代码库同步, 因此对于码农常常准备代理工具, 针对 scoop 可以如下配置进行 git 更新和包下载时采用代理

scoop config proxy 127.0.0.1:1081
scoop config rm proxy

配置加速

一般而言, 下载是采用 wget 命令, 用户可以通过 aria2 进行下载多线程加速(注: 较少时候会表现不好):

scoop install aria2 
# 设置16线程下载
scoop config aria2-max-connection-per-server 16 
# 设置16线程下载分块
scoop config aria2-split 16 
# 设置每个分块的最小体积
scoop config aria2-min-split-size 1M 
# 启用aira2下载,默认安装好后就是启用的
scoop config aria2-enabled true 

安装软件

如下是博主常常使用的一下软件包:

# 日常使用
scoop install wechat wechatwork telegram qbittorrent
# 阅读学习
scoop install calibre
# 笔记软件
scoop install siyuan-note
# 影音必备
scoop install potplayer plex-desktop neteasemusic
# 开发必备
scoop install coreutils windows-terminal
# IDE 等
scoop install vscode pycharm idea
# 效率工具
scoop install trafficmonitor snipaste everything bitwarden dismplusplus utools

美化终端

目前 WINDOWS 推荐使用 Windows Terminal, 以往答主通常采用 cmder 等, 当时配置后的 Windows Terminal 效果更优.

安装 Powerline

Powerline 使用字形来设置提示符样式. 若不包含, 则针对提示符会显示异常.

根据 参考资料-1 可知 Oh-my-Posh V3 更新后, Cascadia 字体无法完美支持 Powerline.

目前基于 Meslo LGM NF 开发, 可进行下载添加. 也可通过如下命令安装.

scoop install https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/oh-my-posh.json
scoop update
scoop install meslo-nf

注意: 将终端显示字体切换为 Meslo LGM NF 族系字体.

安装 posh-git 以及 oh-my-posh

Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser

在 PowerShell 中设置 Powerline

可通过如下命令, 查看当前效果:

Import-Module posh-git
Import-Module oh-my-posh
Set-PoshPrompt -Theme Paradox

大多数在设置终端样式采用 Set-Theme Paradox, 但博主验证, 会发生 无法将"set-theme"项识别为 cmdlet、函数、脚本文件或可运行程序的名称.请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次.. 参考 Oh-my-posh更新文档可知已经更换为 Set-PoshPrompt -Theme Paradox.

但是每次新开终端均是原样式, 可通过如下命令, 将上述命令写入, 则可每次新建均生效.

notepad $profile

参考资料


Windows 开发工具配置
https://www.windism.cn/2273904557.html
作者
windism
发布于
2021年8月9日
许可协议