mirror of
https://github.com/nushell/nu_scripts.git
synced 2024-10-27 06:19:15 +03:00
Update e-q example config (#129)
This commit is contained in:
parent
c6040bdb50
commit
6e5391752c
@ -4,8 +4,10 @@
|
||||
#
|
||||
# It fethes all definitions and environment variables from the `init` module.
|
||||
|
||||
use ~/.config/nushell/init.nu *
|
||||
def build-config [] { { footer_mode: "50" } }
|
||||
|
||||
let config = build-config
|
||||
|
||||
use ~/.config/nushell/init.nu *
|
||||
|
||||
alias gd = git diff
|
||||
|
@ -3,10 +3,8 @@
|
||||
# Init module that exports commands and environment variables wanted at startup
|
||||
|
||||
# commands
|
||||
export def build-config [] { { footer_mode: "50" } }
|
||||
|
||||
export def egd [...rest] {
|
||||
with-env [GIT_EXTERNAL_DIFF 'difftastic'] { git diff $rest }
|
||||
with-env [GIT_EXTERNAL_DIFF 'difft'] { git diff $rest }
|
||||
}
|
||||
|
||||
# env
|
||||
@ -17,7 +15,7 @@ export env LS_COLORS {
|
||||
"mi=00;40;31"
|
||||
"ln=00;36"
|
||||
"ex=00;32"
|
||||
] | str collect ':'
|
||||
] | str collect (char env_sep)
|
||||
}
|
||||
export env BROWSER { "firefox" }
|
||||
export env CARGO_TARGET_DIR { "~/.cargo/target" }
|
||||
@ -25,26 +23,26 @@ export env EDITOR { "nvim" }
|
||||
export env VISUAL { "nvim" }
|
||||
export env PAGER { "less" }
|
||||
export env SHELL { "~/.cargo/bin/nu" }
|
||||
export env JULIA_NUM_THREADS { (nproc) }
|
||||
export env HOSTNAME { (hostname | split row '.' | first | str trim) }
|
||||
export env JULIA_NUM_THREADS { nproc }
|
||||
export env HOSTNAME { hostname | split row '.' | first | str trim }
|
||||
export env SHOW_USR { "true" }
|
||||
|
||||
# prompt
|
||||
export env PROMPT_COMMAND { "build-prompt" }
|
||||
export def build-prompt [] {
|
||||
let usr-str = (if $nu.env.SHOW_USR == "true" {
|
||||
let usr-str = (if $env.SHOW_USR == "true" {
|
||||
[
|
||||
$nu.env.USER
|
||||
$env.USER
|
||||
'@'
|
||||
$nu.env.HOSTNAME
|
||||
$env.HOSTNAME
|
||||
':'
|
||||
] | str collect
|
||||
} else {
|
||||
''
|
||||
})
|
||||
|
||||
let pwd-str = (if (pwd | str starts-with $nu.env.HOME).0 {
|
||||
(pwd | str find-replace $nu.env.HOME '~' | str trim).0
|
||||
let pwd-str = (if (pwd | str starts-with $env.HOME).0 {
|
||||
(pwd | str find-replace $env.HOME '~' | str trim).0
|
||||
} else {
|
||||
pwd
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user