From 4746b72683b53651473dd63a3e752938dd697e47 Mon Sep 17 00:00:00 2001 From: Daveanand Mannie Date: Sat, 7 Sep 2024 17:00:49 -0400 Subject: [PATCH] udpated powershell profile --- init.lua | 1 - pwsh_profile.ps1 | 26 +++++++------------------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/init.lua b/init.lua index b6ef49e..01aed6c 100644 --- a/init.lua +++ b/init.lua @@ -2,7 +2,6 @@ require("config.lazy") -- powershell so my shit compiles with zig when i install 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.shellpipe = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode" vim.o.shellquote = "" diff --git a/pwsh_profile.ps1 b/pwsh_profile.ps1 index d9a8c92..671bb33 100644 --- a/pwsh_profile.ps1 +++ b/pwsh_profile.ps1 @@ -1,37 +1,24 @@ #### Don't forget to add this to the the profile default location is $PROFILE function Write-Display-Header { - param ( - [string]$HeaderText = "Hello", - [ConsoleColor]$HeaderTextColor = [ConsoleColor]::Magenta - ) $HeaderText = "💻 Hello Daveanand 💻" - # Get terminal width $width = $host.UI.RawUI.WindowSize.Width # Create the header line and padding $line = "=" * $width $padding = [math]::Max(0, ($width - $HeaderText.Length) / 2) - - # Print the header line with `=` characters Write-Host $line - - # Print the header text centered Write-Host (" " * $padding) -NoNewline - Write-Host $HeaderText -ForegroundColor $HeaderTextColor -NoNewline + Write-Host $HeaderText -ForegroundColor Magenta -NoNewline Write-Host (" " * $padding) - - # Print the bottom line Write-Host $line } function Show-LoadingWheel { - $duration = 2 - # Define spinner characters - $spinnerChars = @('|', '/', '', '\') - - $delay = 25 # Adjust this value for spinner speed + $duration = 1 + $spinnerChars = @('|', '/', '-', '\') + $delay = 75 # Calculate the number of iterations based on the duration and spinner delay $iterations = [math]::Ceiling(($duration * 1000) / $delay) @@ -53,6 +40,7 @@ function Show-LoadingWheel { break } + Start-Sleep -Milliseconds $delay } } @@ -60,11 +48,11 @@ function Show-LoadingWheel $host.UI.RawUI.CursorPosition = @{X=0;Y=$host.UI.RawUI.CursorPosition.Y} Write-Host " " | Out-Null } -######### execution ############### +# =================== execution =================== # Show-LoadingWheel | Out-Null Write-Display-Header -##################### Aliases ############################# +#==================== Aliases ===========================# function lsd {