Skip to content

Commit

Permalink
fix(*): prepared for nushell/nushell#9574 let-env removal
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasLeonhard committed Jul 13, 2023
1 parent fa0aea4 commit fc7e7f3
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion config.nu
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use theme.nu

# The default config record. This is where much of your global configuration is setup.
let-env config = {
$env.config = {
# true or false to enable or disable the welcome banner at startup
show_banner: false
ls: {
Expand Down
14 changes: 7 additions & 7 deletions env.nu
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# - converted from a string to a value on Nushell startup (from_string)
# - converted from a value back to a string when running external commands (to_string)
# Note: The conversions happen *after* config.nu is loaded
let-env ENV_CONVERSIONS = {
$env.ENV_CONVERSIONS = {
"PATH": {
from_string: { |s| $s | split row (char esep) | path expand --no-symlink }
to_string: { |v| $v | path expand --no-symlink | str join (char esep) }
Expand All @@ -18,21 +18,21 @@ let-env ENV_CONVERSIONS = {
# Directories to search for scripts when calling source or use
#
# By default, <nushell-config-dir>/scripts is added
let-env NU_LIB_DIRS = [
$env.NU_LIB_DIRS = [
($nu.default-config-dir | path join 'scripts')
]

# Directories to search for plugin binaries when calling register
#
# By default, <nushell-config-dir>/plugins is added
let-env NU_PLUGIN_DIRS = [
$env.NU_PLUGIN_DIRS = [
($nu.default-config-dir | path join 'plugins')
]

# Configuration
let-env EDITOR = "nvim"
let-env VISUAL = "nvim"
let-env PNPM_HOME = $"($env.HOME)/Library/pnpm"
$env.EDITOR = "nvim"
$env.VISUAL = "nvim"
$env.PNPM_HOME = $"($env.HOME)/Library/pnpm"

$env.PATH = (
$env.PATH
Expand All @@ -54,7 +54,7 @@ mkdir ~/.cache/carapace
carapace _carapace nushell | save --force ~/.cache/carapace/init.nu
# .env - Starship prompt (starship.rs)
let-env STARSHIP_CONFIG = $env.HOME + '/.config/starship/starship.toml'
$env.STARSHIP_CONFIG = $env.HOME + '/.config/starship/starship.toml'
mkdir ~/.cache/starship
starship init nu | save -f ~/.cache/starship/init.nu
Expand Down
2 changes: 1 addition & 1 deletion scripts/fnm.nu
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# FNM PATH
if not (which fnm | is-empty) {
^fnm env --json | from json | load-env
let-env PATH = ($env.PATH | prepend [
$env.PATH = ($env.PATH | prepend [
$"($env.FNM_MULTISHELL_PATH)/bin"
])
}
8 changes: 4 additions & 4 deletions scripts/prompt_indicator.nu
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 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 = {|| "::: " }
$env.PROMPT_INDICATOR = { || "$" }
$env.PROMPT_INDICATOR_VI_INSERT = {|| "" }
$env.PROMPT_INDICATOR_VI_NORMAL = {|| "" }
$env.PROMPT_MULTILINE_INDICATOR = {|| "::: " }
2 changes: 1 addition & 1 deletion scripts/zellij.nu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Zellij auto attach
let-env ZELLIJ_CONFIG_DIR = $env.HOME + '/.config/zellij'
$env.ZELLIJ_CONFIG_DIR = $"($env.HOME)/.config/zellij"
if not ("ZELLIJ" in $env) {
zellij attach -c "main"
}
Expand Down

0 comments on commit fc7e7f3

Please sign in to comment.