Last active
February 9, 2022 03:11
-
-
Save Kvieta1990/7c29d5d2acb6b830857adc42dd14e78f to your computer and use it in GitHub Desktop.
Windows Powershell Configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function dir_revised($a) { | |
gci $a | sort-object Name | format-table -AutoSize | |
} | |
Function la($a) { | |
gci $a | sort-object Name | format-table -AutoSize | |
} | |
Function lad($a) { | |
gci -Directory $a | sort-object Name | format-table -AutoSize | |
} | |
Function laf($a) { | |
gci -File $a | sort-object Name | format-table -AutoSize | |
} | |
Function lat($a) { | |
gci $a | sort-object LastWriteTime | format-table -AutoSize | |
} | |
Function lar($a) { | |
gci $a | sort-object LastWriteTime -Descending | format-table -AutoSize | |
} | |
Function rr($a) { | |
remove-item -force -recurse $a | |
} | |
Function less($a) { | |
& "C:\cygwin64\bin\less" $a | |
} | |
Function page($a) { | |
Get-ChildItem $a | Out-Host -Paging | |
} | |
Function pr { | |
sublime_text.exe $profile | |
} | |
Function wla($a) { | |
wsl ls -alh $a | |
} | |
Function wlat($a) { | |
wsl ls -alht $a | |
} | |
Function wlar($a) { | |
wsl ls -alhtr $a | |
} | |
Function condaAct($a) { | |
conda activate $a | |
} | |
Function condaDeAct {conda deactivate} | |
Function rsync($a) { | |
wsl rsync -av $a | |
} | |
Function lic { | |
bash /home/yuanpeng/win_c/Users/yuanp/.ssh/sshproxy.sh | |
cp '\\wsl$\Ubuntu\home\yuanpeng\.ssh\nersc' C:\Users\yuanp\.ssh\ | |
} | |
Function rmc { | |
d:\Dev\RMCProfile_package_V6.7.9\RMCProfile_setup.bat | |
} | |
Function top { | |
While(1) {ps | sort -des cpu | select -f 15 | ft -a; sleep 1; cls} | |
} | |
Function open($a) { | |
explorer $a | |
} | |
Function sns {ssh SNS} | |
Function cori {ssh cori} | |
function prompt | |
{ | |
$ESC = [char]27 | |
Write-Host ("$ESC[1;30;40m[$ESC[1;35;40mZYP$ESC[1;34;40m-$ESC[1;32;40mPS $ESC[1;31;40m@ $ESC[1;36;40m$((get-date -Format ddd)), $((get-date -Format MM))-$((get-date -Format dd))-$((get-date -Format yy)) $ESC[1;31;40m@ $((get-item $pwd).Name)$ESC[1;30;40m]$ESC[1;31;40m$") -nonewline -foregroundcolor Green | |
return " " | |
} | |
del alias:dir -Force | |
Set-Alias -Name vi -Value vim | |
Set-Alias -Name sub -Value subl.exe | |
Set-Alias -Name ca -Value condaAct | |
Set-Alias -Name da -Value condaDeAct | |
Set-Alias -Name dir -Value dir_revised | |
$Title = "Powershell" | |
$host.UI.RawUI.WindowTitle = $Title | |
C:\Users\yuanp\anaconda3\shell\condabin\conda-hook.ps1 | |
conda activate 'C:\Users\yuanp\anaconda3' | |
# autocompletion like bash | |
Set-PSReadlineKeyHandler -Key Tab -Function Complete | |
Set-PSReadlineOption -BellStyle None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment