Repository navigation
Expand file tree
/
Copy pathMicrosoft.PowerShell_profile.ps1
More file actions
88 lines (76 loc) · 2.01 KB
/
Copy pathMicrosoft.PowerShell_profile.ps1
File metadata and controls
88 lines (76 loc) · 2.01 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Invoke-Expression (&starship init powershell)
Set-PSReadLineKeyHandler -Chord Alt+Backspace -Function BackwardKillWord
Set-PSReadLineKeyHandler -Chord Alt+LeftArrow -Function BackwardWord
Set-PSReadLineKeyHandler -Chord Alt+RightArrow -Function NextWord
Set-PSReadLineKeyHandler -Chord Ctrl+D -ScriptBlock {
exit
}
Set-Alias history psch
# 从 env.nu 转换的 alias
Set-Alias la Get-ChildItem -Force
Set-Alias ll Get-ChildItem -Force
Set-Alias g git
Set-Alias pull "git pull"
Set-Alias grep find
Set-Alias dig dog
Set-Alias ping gping
Set-Alias curl curlie
Set-Alias vi nvim
# Docker aliases
function docker-ip {
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $args
}
function dockers {
docker ps --format 'table {{.Names}}`t{{.Image}}`t{{.Status}}'
}
# System aliases
function ip {
if ($IsWindows) {
ipconfig
} else {
ip -color -human-readable -pretty
}
}
function ipa {
if ($IsWindows) {
ipconfig /all
} else {
ip -brief a
}
}
Set-Alias wg wg
Set-Alias sctl systemctl
Set-Alias sctlu "systemctl --user"
Set-Alias jctl journalctl
Set-Alias jctlu "journalctl --user-unit"
Set-Alias apt apt
Set-Alias dpkg dpkg
Set-Alias df Get-Volume
Set-Alias yay paru
# Git functions
function gacp {
param([string[]]$message)
git add .
git commit -m ($message -join " ")
git push
}
function gac {
param([string[]]$message)
git add .
git commit -m ($message -join " ")
}
# 其他函数
function updsrcinfo {
makepkg --printsrcinfo | Out-File -FilePath .SRCINFO -Force
}
$scriptPath = Get-Item $MyInvocation.MyCommand.Path
$targetDir = Split-Path -Path $scriptPath.Target -Parent
# Write-Host "符号链接目标的基础目录: $targetDir"
if ($env:TERM_PROGRAM -eq "WarpTerminal") {
##### WHAT YOU WANT TO ENABLE FOR WARP - BELOW
Function ssh-Warp {
C:\Windows\System32\OpenSSH\ssh.exe -F "$($targetDir)/sshConfigForWarp" $args
}
Set-Alias ssh ssh-Warp
##### WHAT YOU WANT TO ENABLE FOR WARP - ABOVE
}