-
Notifications
You must be signed in to change notification settings - Fork 0
/
.oh-my-posh.nu
executable file
·24 lines (21 loc) · 1.33 KB
/
.oh-my-posh.nu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
export-env {
let-env POWERLINE_COMMAND = 'oh-my-posh'
let-env POSH_THEME = "~/.config/italo.omp.json"
let-env EDITOR = 'vim'
let-env PROMPT_INDICATOR = ""
# By default displays the right prompt on the first line
# making it annoying when you have a multiline prompt
# making the behavior different compared to other shells
let-env PROMPT_COMMAND_RIGHT = {''}
let-env NU_VERSION = (version | get version)
# PROMPTS
let-env PROMPT_MULTILINE_INDICATOR = (^"/home/linuxbrew/.linuxbrew/Cellar/oh-my-posh/12.0.1/bin/oh-my-posh" print secondary $"--config=($env.POSH_THEME)" --shell=nu $"--shell-version=($env.NU_VERSION)")
let-env PROMPT_COMMAND = {
# We have to do this because the initial value of `$env.CMD_DURATION_MS` is always `0823`,
# which is an official setting.
# See https://github.com/nushell/nushell/discussions/6402#discussioncomment-3466687.
let cmd_duration = if $env.CMD_DURATION_MS == "0823" { 0 } else { $env.CMD_DURATION_MS }
let width = (term size | get columns | into string)
^"/home/linuxbrew/.linuxbrew/Cellar/oh-my-posh/12.0.1/bin/oh-my-posh" print primary $"--config=($env.POSH_THEME)" --shell=nu $"--shell-version=($env.NU_VERSION)" $"--execution-time=($cmd_duration)" $"--error=($env.LAST_EXIT_CODE)" $"--terminal-width=($width)"
}
}