PowerShell 养老配置

栏目: 编程工具 · 发布时间: 5年前

内容简介:迫于看不懂原文链接:link:这一步不是必须的,但是如果您

迫于看不懂 arsc 文件,又开始倒腾 PowerShell 玩了,老年人专用配置。大概就是换了换字体,装了个 oh-my-posh ,然后顺便把系统编码改回了 Unicode UTF8 (逃

原文链接:link: blog.boileryao.com/2018/12/pow…

准备字体文件

这一步不是必须的,但是如果您 PowerShell 现有的字体满足不了您的审美的话,建议阅读这一部分。

PowerShell 是支持系统安装的外部字体的,但是对字体有特殊的要求,所以大部分字体都会在 Properties -> Font -> Font 列表中被无情地过滤掉。

推荐到这个仓库( github.com/powerline/f… )来选择喜欢的字体。如果您没有使用 Git 的经验并且不想学习它,请选择下载压缩包然后慢慢挑。下面是一种比较优雅的方法(sparse checkout)来下载特定的字体(aka. 此仓库的部分文件夹):

mkdir powerline
git remote add origin https://github.com/powerline/fonts
git config core.sparsecheckout true
# 选择 UbuntuMono 字体
echo UbuntuMono >> .git/info/sparse-checkout
git pull origin master
复制代码

然后打开文件管理器/字体管理器,安装这些字体。由于有些字体不支持特定字符,建议完成全部配置后再进行修改,以控制变量。

配置 oh-my-posh

为了避免略显麻烦权限问题,建议以 管理员身份运行

# 安装 oh-my-posh 及 依赖
Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser
# 启用 oh-my-posh
Import-Module oh-my-posh
Set-Theme Agnoster
复制代码

配置自启动(类似 Linux.bashrc

if ( -Not (Test-Path $PROFILE)){
	New-Item -Path $PROFILE -Type File
}
notepad $PROFILE
复制代码

然后加一行 Import-Module oh-my-posh (如果没有的话)

当然,如果您喜欢 cowsayparrotsaysl 什么的也可以往里加,这些命令都会在每次启动时执行。


以上所述就是小编给大家介绍的《PowerShell 养老配置》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Open Data Structures

Open Data Structures

Pat Morin / AU Press / 2013-6 / USD 29.66

Offered as an introduction to the field of data structures and algorithms, Open Data Structures covers the implementation and analysis of data structures for sequences (lists), queues, priority queues......一起来看看 《Open Data Structures》 这本书的介绍吧!

MD5 加密
MD5 加密

MD5 加密工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具