常用字体
links:
powershell
下载 Powershell、Windows terminal,并设置透明度及默认的 shell 为 PS。
修改颜色,复制 One Half Dark,并修改名称 One Half Dark (moded) 颜色为#001B26
。
修改字体类 Nerd Font,推荐 JetBrain Mono。
配置 PS 命令脚本
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
| choco install neovim grep choco install JetBrainsMonoNF
nvim .config/powershell/user_profile.ps1
PS C:\Users\msclo> cat .\.config\powershell\user_profile.ps1
Set-Alias vim nvim Set-Alias ll ls Set-Alias g git Set-Alias less 'C:\Program Files\Git\usr\bin\less.exe'
nvim $PROFILE
C:\Users\msclo> cat $PROFILE . $env:USERPROFILE\.config\powershell\user_profile.ps1
Install-Module posh-git -Scope CurrentUser -Force
choco install/upgrade oh-my-posh
Set-Alias oh-my-posh 'C:\Program Files (x86)\oh-my-posh\bin\oh-my-posh' oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/takuya.omp.json" | Invoke-Expression
Install-Module -Name Terminal-Icons -Repository PSGallery -Force
Install-Module -Name Z -Force
Install-Module -Name PSReadline -AllowPrerelease -Scope CurrentUser -Force -SkipPublisherCheck Set-PSReadlineOption -PredictionSource History Set-PSReadlineOption -PredictionViewStyle ListView
choco install fzf Install-Module -Name PSFzf -Force Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+f' -PSReadlineChordReversedHistory 'Ctrl+r'
|
最终完整 user_profile.ps1
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
|
Import-Module posh-git
Import-Module Terminal-Icons
Set-Alias oh-my-posh 'C:\Program Files (x86)\oh-my-posh\bin\oh-my-posh' oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/takuya.omp.json" | Invoke-Expression
Set-PSReadlineOption -BellStyle None Set-PSReadlineKeyHandler -Chord 'Ctrl+d' -Function DeleteChar Set-PSReadlineOption -PredictionSource History Set-PSReadlineOption -PredictionViewStyle ListView
Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+f' -PSReadlineChordReversedHistory 'Ctrl+r'
Set-Alias vim nvim Set-Alias ll ls Set-Alias g git Set-Alias less 'C:\Program Files\Git\usr\bin\less.exe'
function which ($command){ Get-Command -Name $command -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Path -ErrorAction SilentlyContinue }
function Watch-Command { [CmdletBinding(SupportsShouldProcess=$True,ConfirmImpact='High')] param ( [Parameter(Mandatory=$True, ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$True)] [string]$command,
[Parameter(Mandatory=$False, ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$True)] [int]$interval = 2 ) process { $cmd = [scriptblock]::Create($command); While($True) { $output = $cmd.Invoke(); cls; Write-Host "Command: " $command; Write-Host ($output | Out-String); sleep $interval; } } }
|
iwr
powershell 下类似 curl 工具命令
1 2 3 4 5 6 7 8
| iwr https://example.com/file.zip -OutFile file.zip
iwr https://example.com/page.html
$response = iwr https://example.com/api/data -UseBasicParsing
|
net
显示连接过的 wifi 密码
1 2
| netsh wlan show profiles netsh wlan show profiles name="wifi name" key=clear
|
显示 ip
1 2
| ipconfig /all curl -L ip.tool.lu
|
检验网络连通
连接远程桌面
disk
检验磁盘扇区
打开性能监控
net
1 2 3 4
| net user
net user [user-name] /del
|
sfc
服务
1 2 3 4
| sc create ceshi binpath= D:\ceshi\ceshi.exe type= own start= auto displayname= ceshi net start ceshi net stop ceshi sc delete "ceshi"
|
zsh
zsh
通过 devcontainer 插件安装 zsh
1
| git clone --depth 1 https://github.com/devcontainers/features.git && CONFIGURE_ZSH_AS_DEFAULT_SHELL=true USERNAME=$USER ./features/src/common-utils/install.sh
|
fzf
Usage
Install
1
| git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
|
links: