Update nushell configuration
This commit is contained in:
parent
cef557e216
commit
b63e9904f9
@ -1,6 +1,9 @@
|
||||
let-env config = ($env.config | upsert show_banner false)
|
||||
let-env config = ($env.config | upsert rm.always_trash true)
|
||||
let-env config = ($env.config | upsert edit_mode vi)
|
||||
let-env config = ($env.config | upsert history.max_size 100000)
|
||||
let-env config = ($env.config | upsert footer_mode auto)
|
||||
let-env config = ($env.config | upsert history.file_format "sqlite")
|
||||
if not 'config' in $env {
|
||||
$env.config = ([] | into record)
|
||||
}
|
||||
$env.config = ($env.config | upsert show_banner false)
|
||||
$env.config = ($env.config | upsert rm.always_trash true)
|
||||
$env.config = ($env.config | upsert edit_mode vi)
|
||||
$env.config = ($env.config | upsert history.max_size 100000)
|
||||
$env.config = ($env.config | upsert footer_mode auto)
|
||||
$env.config = ($env.config | upsert history.file_format "sqlite")
|
||||
|
@ -2,15 +2,15 @@
|
||||
|
||||
### Load standardised prompt "starship"
|
||||
# TEMP: Custom vi prompt indicators
|
||||
let-env PROMPT_INDICATOR_VI_INSERT = ""
|
||||
let-env PROMPT_INDICATOR_VI_NORMAL = ""
|
||||
$env.PROMPT_INDICATOR_VI_INSERT = ""
|
||||
$env.PROMPT_INDICATOR_VI_NORMAL = ""
|
||||
source ~/.cache/starship/init.nu
|
||||
|
||||
# Specifies how environment variables are:
|
||||
# - 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) }
|
||||
@ -20,48 +20,47 @@ 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 = [ ($nu.default-config-dir | path join 'scripts') ]
|
||||
$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 = [ ($nu.default-config-dir | path join 'plugins') ]
|
||||
|
||||
$env.NU_PLUGIN_DIRS = [ ($nu.default-config-dir | path join 'plugins') ]
|
||||
|
||||
# Add entries to PATH:
|
||||
# From MacOS helper (/usr/libexec/path_helper)
|
||||
let-env PATH = ($env.PATH | split row (char esep) | append "/Library/TeX/texbin")
|
||||
let-env PATH = ($env.PATH | split row (char esep) | append "/Library/Apple/usr/bin")
|
||||
let-env PATH = ($env.PATH | split row (char esep) | append "/opt/homebrew/bin")
|
||||
let-env PATH = ($env.PATH | split row (char esep) | append "/opt/homebrew/sbin")
|
||||
let-env PATH = ($env.PATH | split row (char esep) | append "/usr/local/bin")
|
||||
$env.PATH = ($env.PATH | split row (char esep) | append "/Library/TeX/texbin")
|
||||
$env.PATH = ($env.PATH | split row (char esep) | append "/Library/Apple/usr/bin")
|
||||
$env.PATH = ($env.PATH | split row (char esep) | append "/opt/homebrew/bin")
|
||||
$env.PATH = ($env.PATH | split row (char esep) | append "/opt/homebrew/sbin")
|
||||
$env.PATH = ($env.PATH | split row (char esep) | append "/usr/local/bin")
|
||||
# Optional Homebrew packages
|
||||
let-env PATH = ($env.PATH | split row (char esep) | prepend $"(brew --prefix | str trim)/opt/bison/bin")
|
||||
let-env PATH = ($env.PATH | split row (char esep) | prepend $"(brew --prefix | str trim)/opt/flex/bin")
|
||||
let-env PATH = ($env.PATH | split row (char esep) | prepend $"(brew --prefix | str trim)/opt/llvm/bin")
|
||||
let-env PATH = ($env.PATH | split row (char esep) | prepend $"(brew --prefix | str trim)/opt/openjdk/bin")
|
||||
$env.PATH = ($env.PATH | split row (char esep) | prepend $"(brew --prefix | str trim)/opt/bison/bin")
|
||||
$env.PATH = ($env.PATH | split row (char esep) | prepend $"(brew --prefix | str trim)/opt/flex/bin")
|
||||
$env.PATH = ($env.PATH | split row (char esep) | prepend $"(brew --prefix | str trim)/opt/llvm/bin")
|
||||
$env.PATH = ($env.PATH | split row (char esep) | prepend $"(brew --prefix | str trim)/opt/openjdk/bin")
|
||||
# Other package managers
|
||||
let-env PATH = ($env.PATH | split row (char esep) | prepend $"($env.HOME)/.local/bin")
|
||||
let-env PATH = ($env.PATH | split row (char esep) | prepend $"($env.HOME)/.cargo/bin")
|
||||
$env.PATH = ($env.PATH | split row (char esep) | prepend $"($env.HOME)/.local/bin")
|
||||
$env.PATH = ($env.PATH | split row (char esep) | prepend $"($env.HOME)/.cargo/bin")
|
||||
|
||||
# --- user custom ---
|
||||
# Set default editor
|
||||
let-env EDITOR = "nvim"
|
||||
let-env VISUAL = "codium"
|
||||
$env.EDITOR = "nvim"
|
||||
$env.VISUAL = "codium"
|
||||
# Alias for Monash compute cluster
|
||||
let-env OPTCLUSTER = "compute.optimisation-2020.cloud.edu.au"
|
||||
$env.OPTCLUSTER = "compute.optimisation-2020.cloud.edu.au"
|
||||
# CMake settings
|
||||
let-env CMAKE_EXPORT_COMPILE_COMMANDS = "1" # output compile-commands.json for clangd
|
||||
let-env CMAKE_GENERATOR = "Ninja Multi-Config" # use Ninja generator by default
|
||||
let-env CMAKE_C_COMPILER_LAUNCHER = "ccache"
|
||||
let-env CMAKE_CXX_COMPILER_LAUNCHER = "ccache"
|
||||
$env.CMAKE_EXPORT_COMPILE_COMMANDS = "1" # output compile-commands.json for clangd
|
||||
$env.CMAKE_GENERATOR = "Ninja Multi-Config" # use Ninja generator by default
|
||||
$env.CMAKE_C_COMPILER_LAUNCHER = "ccache"
|
||||
$env.CMAKE_CXX_COMPILER_LAUNCHER = "ccache"
|
||||
# Homebrew shell setup (brew shellenv)
|
||||
let-env HOMEBREW_PREFIX = "/opt/homebrew"
|
||||
let-env HOMEBREW_CELLAR = "/opt/homebrew/Cellar"
|
||||
let-env HOMEBREW_REPOSITORY = "/opt/homebrew"
|
||||
let-env INFOPATH = "/opt/homebrew/share/info"
|
||||
$env.HOMEBREW_PREFIX = "/opt/homebrew"
|
||||
$env.HOMEBREW_CELLAR = "/opt/homebrew/Cellar"
|
||||
$env.HOMEBREW_REPOSITORY = "/opt/homebrew"
|
||||
$env.INFOPATH = "/opt/homebrew/share/info"
|
||||
# Set MANPATH
|
||||
let-env MANPATH = "/usr/share/man:/usr/local/share/man:/Library/TeX/Distributions/.DefaultTeX/Contents/Man:/opt/homebrew/share/man"
|
||||
$env.MANPATH = "/usr/share/man:/usr/local/share/man:/Library/TeX/Distributions/.DefaultTeX/Contents/Man:/opt/homebrew/share/man"
|
||||
|
||||
### Setup aliases
|
||||
alias edit = ^($env.VISUAL)
|
||||
|
Loading…
x
Reference in New Issue
Block a user