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
[gpg]
program = /home/trivernis/.local/share/scripts/gpg-pinentry-loopback.bash
[push]
autoSetupRemote = true

@ -1,9 +1,9 @@
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 [] {
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" [

@ -178,10 +178,10 @@ let-env config = {
show_banner: false # true or false to enable or disable the banner
hooks: {
pre_prompt: [{
pre_prompt: [{||
$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
}]
env_change: {

@ -13,21 +13,21 @@ def create_left_prompt [] {
def create_right_prompt [] {
let time_segment = ([
(date now | date format '%m/%d/%Y %r')
] | str collect)
] | str join)
$time_segment
}
# Use nushell functions to define your right and left prompt
let-env PROMPT_COMMAND = { create_left_prompt }
let-env PROMPT_COMMAND_RIGHT = { create_right_prompt }
let-env PROMPT_COMMAND = {|| create_left_prompt }
let-env PROMPT_COMMAND_RIGHT = {|| create_right_prompt }
# The prompt indicators are environmental variables that represent
# the state of the prompt
let-env PROMPT_INDICATOR = { "〉" }
let-env PROMPT_INDICATOR_VI_INSERT = { ": " }
let-env PROMPT_INDICATOR_VI_NORMAL = { "〉" }
let-env PROMPT_MULTILINE_INDICATOR = { "::: " }
let-env PROMPT_INDICATOR = {|| "〉" }
let-env PROMPT_INDICATOR_VI_INSERT = {|| ": " }
let-env PROMPT_INDICATOR_VI_NORMAL = {|| "〉" }
let-env PROMPT_MULTILINE_INDICATOR = {|| "::: " }
# Specifies how environment variables are:
# - 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 = {
"PATH": {
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": {
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?
let-env PROMPT_INDICATOR = ""
let-env PROMPT_COMMAND = {
let-env PROMPT_COMMAND = {||
# jobs are not supported
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)"
@ -15,4 +15,4 @@ let-env PROMPT_COMMAND = {
# Not well-suited for `starship prompt --right`.
# 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`.
let-env PROMPT_COMMAND_RIGHT = {''}
let-env PROMPT_COMMAND_RIGHT = {||''}

Loading…
Cancel
Save