From 7193335733312cb35d28e500d2038939c9895943 Mon Sep 17 00:00:00 2001 From: trivernis Date: Wed, 5 Apr 2023 21:52:50 +0200 Subject: [PATCH] Fix nushell config after update --- dot_gitconfig | 2 ++ .../nushell/completions/podman.nu | 6 +++--- private_dot_config/nushell/config.nu | 6 +++--- private_dot_config/nushell/env.nu | 18 +++++++++--------- private_dot_config/nushell/starship.nu | 4 ++-- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/dot_gitconfig b/dot_gitconfig index 61a4a24..6ce6219 100644 --- a/dot_gitconfig +++ b/dot_gitconfig @@ -49,3 +49,5 @@ rebase = false [gpg] program = /home/trivernis/.local/share/scripts/gpg-pinentry-loopback.bash +[push] + autoSetupRemote = true diff --git a/private_dot_config/nushell/completions/podman.nu b/private_dot_config/nushell/completions/podman.nu index 3867810..f730993 100644 --- a/private_dot_config/nushell/completions/podman.nu +++ b/private_dot_config/nushell/completions/podman.nu @@ -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" [ @@ -23,4 +23,4 @@ export extern "podman stop" [ -i --ignore -l --latest -t: number --time: number -] \ No newline at end of file +] diff --git a/private_dot_config/nushell/config.nu b/private_dot_config/nushell/config.nu index 4be0d72..4884799 100644 --- a/private_dot_config/nushell/config.nu +++ b/private_dot_config/nushell/config.nu @@ -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: { @@ -432,4 +432,4 @@ source ~/.config/nushell/thefuck.nu source ~/.config/nushell/aliases.nu # motd -source ~/.config/nushell/motd.nu \ No newline at end of file +source ~/.config/nushell/motd.nu diff --git a/private_dot_config/nushell/env.nu b/private_dot_config/nushell/env.nu index 514ab8c..63aefcf 100644 --- a/private_dot_config/nushell/env.nu +++ b/private_dot_config/nushell/env.nu @@ -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) } } } diff --git a/private_dot_config/nushell/starship.nu b/private_dot_config/nushell/starship.nu index 6fa5904..673f2cf 100644 --- a/private_dot_config/nushell/starship.nu +++ b/private_dot_config/nushell/starship.nu @@ -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 = {||''}