Featured image of post 新机初始化配置

新机初始化配置

  最近几天因为导师给的ThinkPad X1 Carbon实在是一言难尽(但是不得不说X1 Carbon是真的精致,碳纤维总成,合格的接口,4K的屏幕,长键程,但是里子真的用的难受,16G的内存配合win11实在是不够用,稍微跑点程序,风扇就呼呼起飞,边缘烫的一,真的难为它这个单风扇单热管了。)还是忍不住换了个新机子,之前用的YOGA玻璃覆盖的A面真的很喜欢,于是在小黄鱼上3900同城买了个YOGA Air 14s 2023,也算是新老交替了,开一篇文记录一下新机子到手的一系列配置,maybe若干年后换新笔电也能做个参考。

基本配置

  系统目前来说win11 24H2专业版已经使用习惯了,已经回不去win10咧,到手激活后把能更新的驱动都更新完毕,然后直接关闭更新:

  进入系统注册表,找到以下路径:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings,新建DWORDFlightSettingsMaxPauseDays = 10000

  系统组件中安装WMIC组件

软件配置

  具体清单如下:

软件安装清单
类别 软件名称 备注
办公 office
Visio
软件环境 Anaconda
Git
NodeJs
PowerShell7 oh-my-posh配置
Zerotier 添加moon节点
Latex VsCode 配置settings.json
日常生活 微信
百度网盘
腾讯会议
Claunch
Everything
Mihomo Party
Moonlight
OBS
OneCommander
Potpalyer
Snipaste
TranslucentTB
笔记学习 Obsidian
Notion
IDE Vs Code
Matlab
XShell

Anaconda配置

  在 清华源镜像地址 下载对应系统版本的镜像(Anaconda3-2025.12-1-Windows-x86_64.exe),正常安装即可。
  在系统变量Path里面添加一下内容:

1
2
3
4
5
C:\Software\Anaconda
C:\Software\Anaconda\Scripts
C:\Software\Anaconda\Library\bin
C:\Software\Anaconda\Library\usr\bin
C:\Software\Anaconda\Library\mingw-w64

  额外配置一下 Anaconda 仓库与第三方源,参考 清华源使用方法

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# create .condarc
conda config --set show_channel_urls yes

# Add config below
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
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

  Anaconda基本配置结束,包管理和包缓存默认在C盘不做啥改动(( •̀ .̫ •́ )✧),附一些conda的指令。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
conda info

conda create -n env_name python=3.xx
conda env list
conda activate env_name

conda remove --name env_name --all
conda remove --name env_name  package_name

conda list
conda install package_name

Git配置

  Git下载网址,下载对应系统版本的安装包,默认安装即可(其中默认分支的名字个人这边习惯用main,其他不做修改)。
  安装完成,添加以下配置信息:

1
2
3
4
5
6
7
git config --global user.name "Your Name"
git config --global user.email "email@example.com

git config --global http.proxy 'http://127.0.0.1:7890'
git config --global https.proxy 'https://127.0.0.1:7890'

git config list

Node.js配置

PowerShell美化

  有几次安装出现过oh-my-posh源文件不在正常路径,这边保险起见在Microsoft Store中安装PowerShell和oh-my-posh。安装内容
  安装Nerd Fonts,这里我选的是JetBrainsMono Nerd Font Mono。

1
git clone https://github.com/ryanoasis/nerd-fonts.git

  接下来配置oh-my-posh主题,所带的主题非常多,可以浏览这个网址: oh-my-posh主题 进行选择,主题所在的位置:C:\Users\用户名\AppData\Local\Programs\oh-my-posh\themes\。确定主题之后,需要对主题的配置文件进行修改,因为大部分主题默认设置下会不显示所在的conda环境,比较不方便,我这边借鉴的是armo主题,并进行了一些自定义修改。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "blocks": [
    {
      "alignment": "left",
      "segments": [
        {
          "foreground": "#45F1C2",
          "style": "plain",
          "template": "\ueb99 {{ .UserName }} on",
          "type": "session"
        },
        {
          "foreground": "#0CA0D8",
          "properties": {
            "folder_separator_icon": "/",
            "style": "full"
          },
          "style": "plain",
          "template": " \uf07b {{ .Path }} ",
          "type": "path"
        },
        {
          "foreground": "#14A5AE",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "fetch_status": true,
            "fetch_upstream_icon": true
          },
          "style": "plain",
          "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ if .Staging.Changed }}<#77BBDD> ヾ(•ω•`)o</>{{ end }}{{ if .Working.Changed }}<#FF8899> >﹏<</>{{ end }}{{ if and (not .Staging.Changed) (not .Working.Changed) }}<#77DD77> ٩(•̤̀ᵕ•̤́๑)ᵒᵏᵎᵎᵎᵎ</>{{ end }} ",
          "type": "git"
        },
        {
          "type": "python",
          "style": "plain",
          "foreground": "#98C379",
          "properties": {
            "display_virtual_env": true,
            "display_default": true,
            "display_version": false,
            "home_enabled": true,
            "prefix": "\uE235 ",
            "postfix": " ",
            "display_mode": "always"
          }
          }
      ],
      "type": "prompt"
    },
    {
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "foreground": "#cd5e42",
          "style": "plain",
          "template": "\ue3bf ",
          "type": "root"
        },
        {
          "foreground": "#CD4277",
          "style": "plain",
          "template": "# ",
          "type": "text"
        }
      ],
      "type": "prompt"
    }
  ],
  "version": 3
}

  下面配置PowerShell的使用设置。

1
2
3
4
# 安装scoop(可选,包管理也可以用winget)

# winget安装模块
Install-Module -Name Terminal-Icons -Repository PSGallery

  这一块补全一下Microsoft.PowerShell_profile.ps1的设置流程

1
2
# 打开配置文件
notepad $PROFILE

  如果配置文件不存在,则根据记事本提示创建新文件,默认位置在:C:\Users\用户名\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
  下面是PowerShell配置文件内容:

1
2
3
4
5
6
7
# 选择自己想要的主题文件
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\xy.omp.json" | Invoke-Expression

# 使用 Terminal-Icons
Import-Module Terminal-Icons

cls

  配置好PowerShell7后再配置系统自带的终端,让其默认以PowerShell打开。 alt text 终端中的PowerShell外观配置:配色方案Ottosson,字体JetBrainsMono Nerd Font Mono,不透明度70%。
  VsCode中同样配置好终端字体:‘设置’—>‘Terminal Intergarted Font Family’—>‘JetBrainsMono Nerd Font Mono’

一些好用的软件

Raycast

  今天在北京出差,偶然间刷到了一个关于Raycast的视频,现在进行windows的内测,感觉挺有意思的,想到了之前用Listary的时候,Listary使用的时候有一个很难受的问题是会自动建立U盘的索引,一旦U盘文件多了以后就会,很长时间内就无法弹出U盘,虽然可以设置Listary不建立索引,但是偶尔偶尔也会产生bug,比较奇葩。Raycast原先是适配MacOs的,之前用Mac的时候command+Q直接进行搜索确实方便,现在有了Raycast直接Alt+Space能做到类似的效果,比较喜欢,开一节记录一下使用感受ヾ(•ω•`)o

  基本配置结束,好麻烦啊,要是能一键记忆系统配置就好了>︿<。

2025.12.18 22:03 Update.

Licensed under CC BY-NC-SA 4.0
“普通”とか”あたりまえ”ってなんだろう?
使用 Hugo 构建
主题 StackJimmy 设计
本博客已稳定运行