]> us-delaporte.pagekite.me Git - dotfiles.git/blob - files/Microsoft.PowerShell_profile.ps1
Add alias for invoke
[dotfiles.git] / files / Microsoft.PowerShell_profile.ps1
1 $env:src = "$HOME\src"
2 $env:dotfiles = "$HOME\dotfiles"
3 Import-Module $env:dotfiles\psmodules\add_to_profile.psm1
4 Add-ToProfile $env:dotfiles\files\paths.ps1
5 Add-ToProfile $env:dotfiles\files\env.ps1
6
7 # Delay loading PoshGit for speed.
8 function Enable-PoshGit {
9 Import-Module posh-git
10 }
11 New-Alias pg Enable-PoshGit
12
13 Set-Alias code codium # Prefer Codium
14
15 # Dashboard
16 New-Alias dash Show-MyDashboard # from dash.psm1
17 New-Alias today Get-JournalAgenda
18
19 # Vi
20 New-Alias vi nvim
21 New-Alias vim nvim
22
23 # You can pry my unix commands out of my cold dead fingers
24 if($iswindows) {
25 Set-Alias which get-command
26 }
27 # Reject Windows heritage, act like Vi
28 # Set-PSReadlineOption -HistorySavePath $env:src\PSHistory.log
29 Set-PSReadlineOption -BellStyle Visual
30 Set-PSReadlineOption -ViModeIndicator Prompt
31 Set-PSReadlineOption -EditMode Vi
32
33 Write-Host "+ Type 'pg' to enable PoshGit"
34 Write-Host 'See $env:realProfile for version controlled profile file.'
35
36 # Load dotfiles modules
37 $env:psmodules = "$env:dotfiles\psmodules"
38 Import-Module "$env:psmodules\dash.psm1"
39 Import-Module $env:psmodules\file_management.psm1
40 Import-Module "$env:psmodules\fix_vpn.psm1"
41
42 $maybe_mods = @(
43 "$env:src\travel-times\travel-times.psm1",
44 "$env:src\powershell-scripts\modules\AgileGitHubCLI.psm1"
45 )
46 $maybe_mods | ForEach-Object {
47 if(Test-Path $_) {
48 Import-Module $_
49 } else {
50 Write-Host "Not found: $_"
51 }
52 }
53
54
55 # Load local source modules
56 # Import-Module $env:src\powershell-scripts\modules\MarkdownGitHub.psm1
57
58 # Let's face it, I'm about to cd into my source directory
59 if((Get-Location).Path -eq $HOME){ cd $env:src }