udpated powershell profile
This commit is contained in:
1
init.lua
1
init.lua
@@ -2,7 +2,6 @@
|
|||||||
require("config.lazy")
|
require("config.lazy")
|
||||||
-- powershell so my shit compiles with zig when i install
|
-- powershell so my shit compiles with zig when i install
|
||||||
vim.o.shell = "C:/Program Files/PowerShell/7/pwsh.exe"
|
vim.o.shell = "C:/Program Files/PowerShell/7/pwsh.exe"
|
||||||
-- vim.o.shellcmdflag = "-nologo -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;"
|
|
||||||
vim.o.shellredir = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode"
|
vim.o.shellredir = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode"
|
||||||
vim.o.shellpipe = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode"
|
vim.o.shellpipe = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode"
|
||||||
vim.o.shellquote = ""
|
vim.o.shellquote = ""
|
||||||
|
|||||||
@@ -1,37 +1,24 @@
|
|||||||
#### Don't forget to add this to the the profile default location is $PROFILE
|
#### Don't forget to add this to the the profile default location is $PROFILE
|
||||||
function Write-Display-Header
|
function Write-Display-Header
|
||||||
{
|
{
|
||||||
param (
|
|
||||||
[string]$HeaderText = "Hello",
|
|
||||||
[ConsoleColor]$HeaderTextColor = [ConsoleColor]::Magenta
|
|
||||||
)
|
|
||||||
$HeaderText = "💻 Hello Daveanand 💻"
|
$HeaderText = "💻 Hello Daveanand 💻"
|
||||||
|
|
||||||
# Get terminal width
|
|
||||||
$width = $host.UI.RawUI.WindowSize.Width
|
$width = $host.UI.RawUI.WindowSize.Width
|
||||||
|
|
||||||
# Create the header line and padding
|
# Create the header line and padding
|
||||||
$line = "=" * $width
|
$line = "=" * $width
|
||||||
$padding = [math]::Max(0, ($width - $HeaderText.Length) / 2)
|
$padding = [math]::Max(0, ($width - $HeaderText.Length) / 2)
|
||||||
|
|
||||||
# Print the header line with `=` characters
|
|
||||||
Write-Host $line
|
Write-Host $line
|
||||||
|
|
||||||
# Print the header text centered
|
|
||||||
Write-Host (" " * $padding) -NoNewline
|
Write-Host (" " * $padding) -NoNewline
|
||||||
Write-Host $HeaderText -ForegroundColor $HeaderTextColor -NoNewline
|
Write-Host $HeaderText -ForegroundColor Magenta -NoNewline
|
||||||
Write-Host (" " * $padding)
|
Write-Host (" " * $padding)
|
||||||
|
|
||||||
# Print the bottom line
|
|
||||||
Write-Host $line
|
Write-Host $line
|
||||||
}
|
}
|
||||||
function Show-LoadingWheel
|
function Show-LoadingWheel
|
||||||
{
|
{
|
||||||
$duration = 2
|
$duration = 1
|
||||||
# Define spinner characters
|
$spinnerChars = @('|', '/', '-', '\')
|
||||||
$spinnerChars = @('|', '/', '', '\')
|
$delay = 75
|
||||||
|
|
||||||
$delay = 25 # Adjust this value for spinner speed
|
|
||||||
|
|
||||||
# Calculate the number of iterations based on the duration and spinner delay
|
# Calculate the number of iterations based on the duration and spinner delay
|
||||||
$iterations = [math]::Ceiling(($duration * 1000) / $delay)
|
$iterations = [math]::Ceiling(($duration * 1000) / $delay)
|
||||||
@@ -53,6 +40,7 @@ function Show-LoadingWheel
|
|||||||
{
|
{
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
Start-Sleep -Milliseconds $delay
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,11 +48,11 @@ function Show-LoadingWheel
|
|||||||
$host.UI.RawUI.CursorPosition = @{X=0;Y=$host.UI.RawUI.CursorPosition.Y}
|
$host.UI.RawUI.CursorPosition = @{X=0;Y=$host.UI.RawUI.CursorPosition.Y}
|
||||||
Write-Host " " | Out-Null
|
Write-Host " " | Out-Null
|
||||||
}
|
}
|
||||||
######### execution ###############
|
# =================== execution =================== #
|
||||||
Show-LoadingWheel | Out-Null
|
Show-LoadingWheel | Out-Null
|
||||||
Write-Display-Header
|
Write-Display-Header
|
||||||
|
|
||||||
##################### Aliases #############################
|
#==================== Aliases ===========================#
|
||||||
|
|
||||||
function lsd
|
function lsd
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user