Files
dotfiles/AppData/Roaming/nushell/env.nu
T

36 lines
1.1 KiB
Nu

# env.nu
# Nushell Environment Configuration
# Ensure cache directory exists
try { mkdir ~/.cache/nushell }
# Initialize Zoxide
if (which zoxide | is-not-empty) {
zoxide init nushell | save -f ~/.cache/nushell/zoxide.nu
} else {
"" | save -f ~/.cache/nushell/zoxide.nu
}
# Initialize Starship
if (which starship | is-not-empty) {
starship init nu | save -f ~/.cache/nushell/starship.nu
} else {
"" | save -f ~/.cache/nushell/starship.nu
}
# Set default editor and pager
$env.EDITOR = "nvim"
$env.VISUAL = "nvim"
$env.PAGER = "bat --paging=always"
# Modern PowerShell 7 wrapper (pw7) for Nushell
# This matches the behavior of the PowerShell pw7 function by sourcing the Gemini profile
def --env pw7 [cmd: string] {
let profile = "C:\\Users\\reazul.ashraf\\onedrive\\Documents\\PowerShell\\Gemini_Profile.ps1"
# Use -NonInteractive and Out-String to ensure clean string output for JSON parsing
^pwsh.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command $". '($profile)'; ($cmd) | Out-String"
}
# Useful env variables
$env.BAT_THEME = "TwoDark" # Common default, adjust if needed