summaryrefslogtreecommitdiff
path: root/dot_config/powershell/Microsoft.PowerShell_profile.ps1
blob: 6fc61ebcde63a4cecdca56ab5e3ddb0d16ed0f32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Environment variables
$env:XDG_CONFIG_HOME=$(Join-Path "C:" $env:HOMEPATH "\.config")
$env:XDG_DATA_HOME=$(Join-Path "C:" $env:HOMEPATH "\.local\share")
$env:XDG_STATE_HOME=$(Join-Path "C:" $env:HOMEPATH "\.local\state")
$env:EDITOR="nvim"

# Add personal scripts to path
$env:path += ";$env:HOMEPATH\Scripts"

# Use some cool icons
# Import-Module -Name Terminal-Icons

# Git autocompletion for Powershell
# Import-Module -Name posh-git

# Aliases
if (Get-Command -Name 'nvim' -CommandType 'Application' -ErrorAction SilentlyContinue) {
    if (Get-Command -Name 'poetry' -CommandType 'Application' -ErrorAction SilentlyContinue) {
        # Can't create an "alias" with CLI args
        function pn() { & poetry run nvim . }
    }
}

# Load Starship prompt
Invoke-Expression (&starship init powershell)

# Load zoxide
Invoke-Expression (& { (zoxide init powershell | Out-String) })