Improved nushell config
This commit is contained in:
parent
6fc76fe594
commit
df3d1ef735
@ -552,8 +552,10 @@ let-env config = {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
# Custom configuration
|
# Set editor
|
||||||
let-env EDITOR = 'nvim'
|
let-env EDITOR = 'nvim'
|
||||||
|
|
||||||
|
# Aliases
|
||||||
alias ll = ls -l
|
alias ll = ls -l
|
||||||
alias gb = go build
|
alias gb = go build
|
||||||
alias gt = go test
|
alias gt = go test
|
||||||
|
@ -24,29 +24,9 @@ def create_left_prompt [] {
|
|||||||
$path_segment | str replace --all --string (char path_sep) $"($separator_color)/($path_color)"
|
$path_segment | str replace --all --string (char path_sep) $"($separator_color)/($path_color)"
|
||||||
}
|
}
|
||||||
|
|
||||||
def create_right_prompt [] {
|
# Use nushell functions to define your prompt
|
||||||
let time_segment_color = (ansi magenta)
|
|
||||||
|
|
||||||
let time_segment = ([
|
|
||||||
(ansi reset)
|
|
||||||
$time_segment_color
|
|
||||||
(date now | date format '%m/%d/%Y %r')
|
|
||||||
] | str join | str replace --all "([/:])" $"(ansi light_magenta_bold)${1}($time_segment_color)" |
|
|
||||||
str replace --all "([AP]M)" $"(ansi light_magenta_underline)${1}")
|
|
||||||
|
|
||||||
let last_exit_code = if ($env.LAST_EXIT_CODE != 0) {([
|
|
||||||
(ansi rb)
|
|
||||||
($env.LAST_EXIT_CODE)
|
|
||||||
] | str join)
|
|
||||||
} else { "" }
|
|
||||||
|
|
||||||
([$last_exit_code, (char space), $time_segment] | str join)
|
|
||||||
}
|
|
||||||
|
|
||||||
# Use nushell functions to define your right and left prompt
|
|
||||||
let-env PROMPT_COMMAND = {|| create_left_prompt }
|
let-env PROMPT_COMMAND = {|| create_left_prompt }
|
||||||
let-env PROMPT_COMMAND_RIGHT = ""
|
let-env PROMPT_COMMAND_RIGHT = ""
|
||||||
#let-env PROMPT_COMMAND_RIGHT = {|| create_right_prompt }
|
|
||||||
|
|
||||||
# The prompt indicators are environmental variables that represent
|
# The prompt indicators are environmental variables that represent
|
||||||
# the state of the prompt
|
# the state of the prompt
|
||||||
|
Loading…
Reference in New Issue
Block a user