Capture Windows Nushell config

This commit is contained in:
Riz Ashraf
2026-04-07 00:49:58 +01:00
parent 8b6c56b300
commit c33ea4edac
8 changed files with 5984 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
# 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