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