Fix nushell config after update

main
trivernis 2 years ago
parent 4ba07be50b
commit 7193335733
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -49,3 +49,5 @@
rebase = false rebase = false
[gpg] [gpg]
program = /home/trivernis/.local/share/scripts/gpg-pinentry-loopback.bash program = /home/trivernis/.local/share/scripts/gpg-pinentry-loopback.bash
[push]
autoSetupRemote = true

@ -1,9 +1,9 @@
def all_container_names [] { def all_container_names [] {
podman container ls --all --format json | from json | get Names | each { get 0 } podman container ls --all --format json | from json | get Names | each {|| get 0 }
} }
def running_container_names [] { def running_container_names [] {
podman container ls --format json | from json | get Names | each { get 0 } podman container ls --format json | from json | get Names | each {|| get 0 }
} }
export extern "podman start" [ export extern "podman start" [
@ -23,4 +23,4 @@ export extern "podman stop" [
-i --ignore -i --ignore
-l --latest -l --latest
-t: number --time: number -t: number --time: number
] ]

@ -178,10 +178,10 @@ let-env config = {
show_banner: false # true or false to enable or disable the banner show_banner: false # true or false to enable or disable the banner
hooks: { hooks: {
pre_prompt: [{ pre_prompt: [{||
$nothing # replace with source code to run before the prompt is shown $nothing # replace with source code to run before the prompt is shown
}] }]
pre_execution: [{ pre_execution: [{||
$nothing # replace with source code to run before the repl input is run $nothing # replace with source code to run before the repl input is run
}] }]
env_change: { env_change: {
@ -432,4 +432,4 @@ source ~/.config/nushell/thefuck.nu
source ~/.config/nushell/aliases.nu source ~/.config/nushell/aliases.nu
# motd # motd
source ~/.config/nushell/motd.nu source ~/.config/nushell/motd.nu

@ -13,21 +13,21 @@ def create_left_prompt [] {
def create_right_prompt [] { def create_right_prompt [] {
let time_segment = ([ let time_segment = ([
(date now | date format '%m/%d/%Y %r') (date now | date format '%m/%d/%Y %r')
] | str collect) ] | str join)
$time_segment $time_segment
} }
# Use nushell functions to define your right and left prompt # 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 = { create_right_prompt } 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
let-env PROMPT_INDICATOR = { "〉" } let-env PROMPT_INDICATOR = {|| "〉" }
let-env PROMPT_INDICATOR_VI_INSERT = { ": " } let-env PROMPT_INDICATOR_VI_INSERT = {|| ": " }
let-env PROMPT_INDICATOR_VI_NORMAL = { "〉" } let-env PROMPT_INDICATOR_VI_NORMAL = {|| "〉" }
let-env PROMPT_MULTILINE_INDICATOR = { "::: " } let-env PROMPT_MULTILINE_INDICATOR = {|| "::: " }
# Specifies how environment variables are: # Specifies how environment variables are:
# - converted from a string to a value on Nushell startup (from_string) # - converted from a string to a value on Nushell startup (from_string)
@ -36,11 +36,11 @@ let-env PROMPT_MULTILINE_INDICATOR = { "::: " }
let-env ENV_CONVERSIONS = { let-env ENV_CONVERSIONS = {
"PATH": { "PATH": {
from_string: { |s| $s | split row (char esep) | path expand -n } from_string: { |s| $s | split row (char esep) | path expand -n }
to_string: { |v| $v | path expand -n | str collect (char esep) } to_string: { |v| $v | path expand -n | str join (char esep) }
} }
"Path": { "Path": {
from_string: { |s| $s | split row (char esep) | path expand -n } from_string: { |s| $s | split row (char esep) | path expand -n }
to_string: { |v| $v | path expand -n | str collect (char esep) } to_string: { |v| $v | path expand -n | str join (char esep) }
} }
} }

@ -6,7 +6,7 @@ let-env PROMPT_MULTILINE_INDICATOR = (^/usr/bin/starship prompt --continuation)
# TODO: Also Use starship vi mode indicators? # TODO: Also Use starship vi mode indicators?
let-env PROMPT_INDICATOR = "" let-env PROMPT_INDICATOR = ""
let-env PROMPT_COMMAND = { let-env PROMPT_COMMAND = {||
# jobs are not supported # jobs are not supported
let width = (term size | get columns | into string) let width = (term size | get columns | into string)
^/usr/bin/starship prompt $"--cmd-duration=($env.CMD_DURATION_MS)" $"--status=($env.LAST_EXIT_CODE)" $"--terminal-width=($width)" ^/usr/bin/starship prompt $"--cmd-duration=($env.CMD_DURATION_MS)" $"--status=($env.LAST_EXIT_CODE)" $"--terminal-width=($width)"
@ -15,4 +15,4 @@ let-env PROMPT_COMMAND = {
# Not well-suited for `starship prompt --right`. # Not well-suited for `starship prompt --right`.
# Built-in right prompt is equivalent to $fill$right_format in the first prompt line. # Built-in right prompt is equivalent to $fill$right_format in the first prompt line.
# Thus does not play well with default `add_newline = True`. # Thus does not play well with default `add_newline = True`.
let-env PROMPT_COMMAND_RIGHT = {''} let-env PROMPT_COMMAND_RIGHT = {||''}

Loading…
Cancel
Save