X-Git-Url: https://us-delaporte.pagekite.me/gitweb/dotfiles.git/blobdiff_plain/a92983dae20de99ad3fb82c6cffaabee0f72c0e1..bb2bdf021a4e7f79c7c2d9f8480c2f61ca24fa0f:/files/Microsoft.PowerShell_profile.ps1?ds=sidebyside diff --git a/files/Microsoft.PowerShell_profile.ps1 b/files/Microsoft.PowerShell_profile.ps1 index fc17319..ae447fe 100644 --- a/files/Microsoft.PowerShell_profile.ps1 +++ b/files/Microsoft.PowerShell_profile.ps1 @@ -1,8 +1,8 @@ -$env:src = "~\src" -Import-Module $env:src\dotfiles\psmodules\add_to_profile.psm1 -Add-ToProfile $env:src\dotfiles\files\paths.ps1 -Add-ToProfile $env:src\dotfiles\files\env.ps1 -Add-ToProfile $env:src\dotfiles\files\load_modules.ps1 +$env:src = "$HOME\src" +$env:dotfiles = "$HOME\dotfiles" +Import-Module $env:dotfiles\psmodules\add_to_profile.psm1 +Add-ToProfile $env:dotfiles\files\paths.ps1 +Add-ToProfile $env:dotfiles\files\env.ps1 # Delay loading PoshGit for speed. function Enable-PoshGit { @@ -10,15 +10,51 @@ function Enable-PoshGit { } New-Alias pg Enable-PoshGit +Set-Alias code codium # Prefer Codium + +# Dashboard +New-Alias dash Show-MyDashboard # from dash.psm1 +New-Alias today Get-JournalAgenda + +# Vi +New-Alias vi nvim +New-Alias vim nvim + # You can pry my unix commands out of my cold dead fingers -Set-Alias which get-command +if($iswindows) { + Set-Alias which get-command +} # Reject Windows heritage, act like Vi -Set-PSReadlineOption -HistorySavePath $env:src\PSHistory.log +# Set-PSReadlineOption -HistorySavePath $env:src\PSHistory.log Set-PSReadlineOption -BellStyle Visual Set-PSReadlineOption -ViModeIndicator Prompt Set-PSReadlineOption -EditMode Vi Write-Host "+ Type 'pg' to enable PoshGit" Write-Host 'See $env:realProfile for version controlled profile file.' + +# Load dotfiles modules +$env:psmodules = "$env:dotfiles\psmodules" +Import-Module "$env:psmodules\dash.psm1" +Import-Module $env:psmodules\file_management.psm1 +Import-Module "$env:psmodules\fix_vpn.psm1" + +$maybe_mods = @( + "$env:src\travel-times\travel-times.psm1", + "$env:src\powershell-scripts\modules\AgileGitHubCLI.psm1" + ) +$maybe_mods | ForEach-Object { + if(Test-Path $_) { + Import-Module $_ + } else { + Write-Host "Not found: $_" + } +} + +$env:nvim_config = "$HOME\AppData\Local\nvim" + +# Load local source modules +# Import-Module $env:src\powershell-scripts\modules\MarkdownGitHub.psm1 + # Let's face it, I'm about to cd into my source directory -if((Get-Location).Path -eq $HOME){ cd $env:src } \ No newline at end of file +if((Get-Location).Path -eq $HOME){ cd $env:src }