当前位置: 首页 > news >正文

终端美化:Windows11 下 安装 WSL 并使用好看的的 zsh 主题

前言

mac 上使用 spaceship 主题习惯了,想着看看 windows 上能不能使用

效果预览

在这里插入图片描述

步骤

powershell 中安装 wsl,大概等了五分钟左右,安装过程的提示很少,一度以为卡死了

在这里插入图片描述
之后重启,可以看到菜单中多了几个东西

在这里插入图片描述

打开 vscode 看一下

在这里插入图片描述

因为是新下载的 linux 环境,所以什么都没有,连个 node 都没有,要自己安装 在这里插入图片描述
我这里先安装一个 nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

魔法要开 Tun 模式,进度条才有可能往前走

下载完成后提示

root@DESKTOP-H78LOHG:/mnt/e/Study/react-learn# curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash% Total    % Received % Xferd  Average Speed   Time    Time     Time  CurrentDload  Upload   Total   Spent    Left  Speed
100 15037  100 15037    0     0  45111      0 --:--:-- --:--:-- --:--:-- 45020
=> nvm is already installed in /root/.nvm, trying to update using git
=> => Compressing and cleaning up git repository=> nvm source string already in /root/.bashrc
=> bash_completion source string already in /root/.bashrc
=> You currently have modules installed globally with `npm`. These will no
=> longer be linked to the active version of Node when you install a new node
=> with `nvm`; and they may (depending on how you construct your `$PATH`)
=> override the binaries of modules installed with `nvm`:D:\Program Files\nvm\v22.13.1
├── @antfu/ni@23.3.1
├── corepack@0.30.0
├── eslint@9.34.0
└── pnpm@10.15.0
=> If you wish to uninstall them at a later point (or re-install them under your
=> `nvm` Nodes), you can remove them from the system Node as follows:$ nvm use system$ npm uninstall -g a_module=> Close and reopen your terminal to start using nvm or run the following to use it now:export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
root@DESKTOP-H78LOHG:/mnt/e/Study/react-learn#

没啥大病,重启一下终端就行

在这里插入图片描述

然后安装 node

在这里插入图片描述
安装 zsh

sudo apt update
sudo apt install -y zsh

在这里插入图片描述

在这里插入图片描述
切换默认的 shellzsh

 chsh -s $(which zsh)

然后安装 ohmyzsh,一个 zsh 的主题管理工具

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

在这里插入图片描述

然后克隆 https://spaceship-prompt.sh/getting-started/#Installing 的主题文件

之后是编辑一下 zshrc

vim ~/.zshrc

在这里插入图片描述

在这里插入图片描述
ok 已经安装好了

然后在重启一个新的终端,应该能看到熟悉的样式了

在这里插入图片描述

还可以加一些快捷命令

在这里插入图片描述

好看的主题就完成了

在这里插入图片描述

http://www.dtcms.com/a/354041.html

相关文章:

  • 【图论】最短路算法
  • 802.11ax上行OFDMA接入机制:技术原理与实现细节
  • 流水线用到的Dockerfile和构建脚本build.sh
  • Python电影票房预测模型研究——贝叶斯岭回归Ridge、决策树、Adaboost、KNN分析猫眼豆瓣数据
  • MYSQL---存储过程
  • 【轨物方案】“无人值守”光伏电站智能运维解决方案,赋能绿色能源高效运营
  • 正则表达式 —— 贪婪与非贪婪
  • 汽车盲点检测系统的网络安全分析和设计
  • 【Linux学习】正则表达式学习记录
  • 【鸿蒙开发001】上下翻页-翻书效果实现【可复用】
  • 写一个天气查询Mcp Server
  • 2025年9月计算机二级C++语言程序设计——选择题打卡Day8
  • urdf文件可以使用的一些工具(urdf检查和可视化)
  • 【leetcode】100.相同的树
  • Elasticsearch核心配置详解与优化
  • SAP 怎么知道物料的自动过账流程
  • DFT、CHORD
  • “上门经济”的胜利:深度解析家政O2O如何用“用户体验”重塑传统行业
  • 【双指针- LeetCode】15.三数之和
  • CPLD和FPGA的区别
  • LeetCode 560. 和为 K 的子数组
  • Linux827 测试
  • Linux MDIO 深入分析
  • 电子电气架构 --- 软件项目复杂性的驾驭思路
  • [Sync_ai_vid] UNet模型 | 音频特征提取器(Whisper)
  • FPGA实现Aurora 64B66B图像视频传输,基于GTY高速收发器,提供2套工程源码和技术支持
  • 第三阶段数据库-10:存储过程,事务,异常,视图,自定义函数,触发器,N关键字
  • synchronized和Lock有什么区别?
  • Vue3》》基础
  • Ubuntu 20.04.6交叉编译得到Ubuntu 16.04.6的可执行文件