From e45f0b64bfec611559902ffdfb713b4ae5edbabd Mon Sep 17 00:00:00 2001 From: TheFlyingFool Date: Mon, 10 Jun 2024 19:05:15 -0500 Subject: [PATCH] Working to unbranch due to not working as expected --- windows/Microsoft.PowerShell_profile.ps1 | 15 +++++++++++++++ windows/Microsoft.VSCode_profile.ps1 | 9 +++++++++ windows/aliases.ps1 | 7 +++++++ 3 files changed, 31 insertions(+) create mode 100644 windows/Microsoft.PowerShell_profile.ps1 create mode 100644 windows/Microsoft.VSCode_profile.ps1 create mode 100644 windows/aliases.ps1 diff --git a/windows/Microsoft.PowerShell_profile.ps1 b/windows/Microsoft.PowerShell_profile.ps1 new file mode 100644 index 0000000..9e8d80b --- /dev/null +++ b/windows/Microsoft.PowerShell_profile.ps1 @@ -0,0 +1,15 @@ +Register-ArgumentCompleter -Native -CommandName winget -ScriptBlock { + param($wordToComplete, $commandAst, $cursorPosition) + [Console]::InputEncoding = [Console]::OutputEncoding = $OutputEncoding = [System.Text.Utf8Encoding]::new() + $Local:word = $wordToComplete.Replace('"', '""') + $Local:ast = $commandAst.ToString().Replace('"', '""') + winget complete --word="$Local:word" --commandline "$Local:ast" --position $cursorPosition | ForEach-Object { + [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) + } + } + + +function dot { & git --git-dir="$HOME/.dot/" --work-tree="$HOME" @args } + +# Source the aliases.ps1 file +. "$PSScriptRoot/aliases.ps1" diff --git a/windows/Microsoft.VSCode_profile.ps1 b/windows/Microsoft.VSCode_profile.ps1 new file mode 100644 index 0000000..63c8fce --- /dev/null +++ b/windows/Microsoft.VSCode_profile.ps1 @@ -0,0 +1,9 @@ +Register-ArgumentCompleter -Native -CommandName winget -ScriptBlock { + param($wordToComplete, $commandAst, $cursorPosition) + [Console]::InputEncoding = [Console]::OutputEncoding = $OutputEncoding = [System.Text.Utf8Encoding]::new() + $Local:word = $wordToComplete.Replace('"', '""') + $Local:ast = $commandAst.ToString().Replace('"', '""') + winget complete --word="$Local:word" --commandline "$Local:ast" --position $cursorPosition | ForEach-Object { + [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) + } + } diff --git a/windows/aliases.ps1 b/windows/aliases.ps1 new file mode 100644 index 0000000..8030e1f --- /dev/null +++ b/windows/aliases.ps1 @@ -0,0 +1,7 @@ +function Upgrade-All { winget upgrade --all } + +Set-Alias -Name Syu -Value Upgrade-All + +function touch($file) { + "" | Out-File $file -Encoding ASCII +} \ No newline at end of file