























Freewind主题v1.5版本已发布,下载请移步Freewind 1.5,同时还有主题伴生插件Freewind Markdown,下载请移步 Freewind Markdown,有问题请在留言板,交换友链请直接在友链留言,我创建了一个主题交流群,有兴趣可以加下: 点此加入
报毒我说明一下,是因为我把主题的版权信息做了加密,其中用了eval,杀毒软件认为eval函数是一个危险的操作,这点介意的话请勿下载,我也没有强迫任何人去下载,也没有向大家收取一分钱的主题费用,所以也犯不着因为这些事情来喷我,喜欢就用,不喜欢就不用,就这么简单
发布于2022-10-28
winget为例演示,搜索最新版本的 PowerShellwinget search --id Microsoft.PowerShellwinget install --id Microsoft.PowerShell --source winget # 安装最新版winget install --id Microsoft.PowerShell.Preview --source winget # 安装预览版
设置>启动>默认配置文件 中将PowerShell设置为默认,注意不是Windows PowerShell设置>启动>默认终端应用程序中选择Windows终端
设置>配色方案中找到喜欢的配色文字,然后点进去,这里我以One Half Dark为例
将配色方案设置为默认,然后点保存
在设置>操作中可以自定义快捷键,这个根据个人喜好来,这里我一般会加两个快捷键如下:
Ctrl+Q退出终端Ctrl+W关闭窗格设置>配置文件>默认值>外观中进行设置,可以设置字体、字号、粗细等,这里我保持默认,大家根据需求来背景图片中可以设置背景图及不透明度,如果图片比较亮就推荐将不透明度调低,设置完好点保存,如下
PowerShell中执行如下命令Set-ExecutionPolicy RemoteSigned -scope CurrentUser
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')PowerShell中执行如下命令进行安装winget install JanDeDobbeleer.OhMyPosh --source wingetmeslo字体为例oh-my-posh font installnotepad $PROFILENew-Item -Path $PROFILE -Type File -ForceC:\Program Files\WindowsApps\ohmyposh.cli_xxxx\themes\中找到对应的文件robbyrussell这款主题# oh-my-posh init pwsh --config "C:\Program Files\WindowsApps\ohmyposh.cli_xxx\themes\主题文件" | Invoke-Expression
oh-my-posh init pwsh --config "C:\Program Files\WindowsApps\ohmyposh.cli_29.0.2.0_arm64__96v55e8n804z4\themes\robbyrussell.omp.json" | Invoke-Expression此时终端已经美化的差不多了,但我们还需要丰富其功能让它更接近Oh My Zsh
Git Bash可以忽略这一步scoop install gitscoop install vimVim安装目录在C:\Users\kevinlu98\scoop\apps\vim\xxxx,可以创建配置文件_vimrc_vimrc中输入如下内容set fileencodings=utf-8,ucs-bom,cp936,big5
set fileencoding=utf-8
set nu
syntax onPSReadLine实现zsh-autosuggestions插件的功能ESReadLineInstall-Module -Name PowerShellGet -ForceImport-Module PSReadLine
# 设置预测文本来源为历史记录
Set-PSReadLineOption -PredictionSource History
# 设置 Tab 为菜单补全和 Intellisense
Set-PSReadLineKeyHandler -Key "Tab" -Function MenuComplete
# 每次回溯输入历史,光标定位于输入内容末尾
Set-PSReadLineOption -HistorySearchCursorMovesToEnd
# 设置向上键为后向搜索历史记录
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
# 设置向下键为前向搜索历史纪录
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward ZLocation和 autojump 差不多效果,快速 cd 到历史去过的目录ZLocationInstall-Module ZLocation -Scope CurrentUser
设置>配置文件>PowerShell>命令行中在原来的值后面加上 -nologo
sudo 执行管理员权限了scoop install gsudo在配置文件后面追加如下
set ALL_PROXY=http://xx.xx.xx.xx:7890 # 换成自己的魔法Set-Alias ll Get-ChildItemInstall-Module posh-git -Scope CurrentUser -ForceImport-Module posh-git
# ========== 清除可能冲突的别名 ==========
$gitAliasesToRemove = @('gl', 'gp', 'gs', 'gc', 'gcm', 'gal', 'gm')
foreach ($alias in $gitAliasesToRemove) {
if (Get-Alias $alias -ErrorAction SilentlyContinue) {
Remove-Item "Alias:\$alias" -Force
}
}
# 基础命令
function g { git @args }
function gl { git pull @args }
function ga { git add @args }
function gaa { git add --all }
function gap { git add --patch }
# 提交
function gcm { git commit -m @args }
function gcam { git commit -am @args }
function gc { git commit -v }
function gca { git commit -v -a }
function gc! { git commit -v --amend }
function gcan! { git commit -v -a --no-edit --amend }
# 分支
function gb { git branch @args }
function gba { git branch -a }
function gbd { git branch -d @args }
function gco { git checkout @args }
function gcb { git checkout -b @args }
function gsw { git switch @args }
# 日志(使用 gll 而不是 gl 避免冲突)
function gll { git pull @args } # 拉取
function glog { git log --oneline --decorate --color @args }
function gloga { git log --oneline --decorate --color --all --graph }
function glo { git log --oneline --decorate --color @args }
# 推送(使用 gpp 而不是 gp 避免冲突)
function gpp { git push @args }
function gpf { git push --force-with-lease }
# 状态
function gst { git status @args }
function gss { git status -s }
# 差异
function gd { git diff @args }
function gds { git diff --staged }
# 变基
function grb { git rebase @args }
function grbi { git rebase -i @args }
function grbc { git rebase --continue }
# 储藏
function gsta { git stash push }
function gstp { git stash pop }
function gstl { git stash list }
# 其他实用命令
function gr { git remote -v }
function gcl { git clone @args }
function gcp { git cherry-pick @args }
function gmt { git mergetool }
function gcount { git shortlog -sn }此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。