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 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
| function st {git status .} function br {git branch @Args} function di {git difftool @Args} function ad {git add @Args} function ci {git commit @Args} function log {git log --name-only @Args} function log2 {git log --name-only --grep @Args} function log3 {git log --graph --pretty=oneline --abbrev-commit --name-only} function cbl {git log $(git branch --show-current) --name-only} function sml {git log $(git branch --show-current) --name-only --author=forrest @Args} function di2 {git difftool head~10 @Args} function dif {di --name-status @Args} function difd {di --name-status develop} function co {git checkout @Args} function me {git merge --no-ff @Args} function pi {git cherry-pick @Args} function pld {git pull origin develop ; echo "pull develop"} function re {git restore --staged @Args} function dis {git difftool --staged @Args}
function ph {git push origin (git branch --show-current)} function pl {git pull origin (git branch --show-current)}
function did {di develop @Args}
function kc {kubectl @Args} function ll {ls @Args | sort LastWriteTime -Descending}
function ed {C:\Users\user\Desktop\Forrest\Tool\EditPlus\editplus.exe @Args}
function change-to-develop {co develop}
set-alias cod change-to-develop set-alias vi nvim set-alias b bat
function com {co master}
Invoke-Expression (& { $hook = if ($PSVersionTable.PSVersion.Major -lt 6) { 'prompt' } else { 'pwd' } (zoxide init --hook $hook powershell | Out-String) })
Invoke-Expression (&starship init powershell)
Set-PSReadLineKeyHandler -Key Ctrl+b ` -BriefDescription BuildCurrentDirectory ` -LongDescription "Build current project" ` -ScriptBlock { [Microsoft.PowerShell.PSConsoleReadLine]::RevertLine() [Microsoft.PowerShell.PSConsoleReadLine]::Insert("gradle clean build -xtest") [Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine() }
Set-PSReadLineKeyHandler -Key Ctrl+p ` -BriefDescription BuildCurrentDirectory ` -LongDescription "Build and publish current project" ` -ScriptBlock { [Microsoft.PowerShell.PSConsoleReadLine]::RevertLine() [Microsoft.PowerShell.PSConsoleReadLine]::Insert("gradle clean build publishtomavenlocal") [Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine() }
Set-PSReadLineKeyHandler -Key Ctrl+d ` -ScriptBlock { [Microsoft.PowerShell.PSConsoleReadLine]::RevertLine() [Microsoft.PowerShell.PSConsoleReadLine]::Insert("exit") [Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine() }
function mem_used { $CompObject = Get-WmiObject -Class WIN32_OperatingSystem $Memory = ((($CompObject.TotalVisibleMemorySize - $CompObject.FreePhysicalMemory)*100)/ $CompObject.TotalVisibleMemorySize)
Write-Host "Memory usage in Percentage:" $Memory
$processMemoryUsage = Get-WmiObject WIN32_PROCESS | Sort-Object -Property ws -Descending | Select-Object -first 10 processname, @{Name="Mem Usage(MB)";Expression={[math]::round($_.ws / 1mb)}} $processMemoryUsage }
function battery { WMIC PATH Win32_Battery Get EstimatedChargeRemaining }
function fe { fzf | %{ ed $_ } }
set-alias lg lazygit set-alias gt gitui
|