tangled
alpha
login
or
join now
dekker.one
/
dotfiles
0
fork
atom
The general configuration of my development environment and many other general computer things.
0
fork
atom
overview
issues
pulls
pipelines
Add nushell configuration
dekker.one
2 years ago
0a700f76
86e71144
verified
This commit was signed with the committer's
known signature
.
dekker.one
SSH Key Fingerprint:
SHA256:ca4pdN0aciUZT7uFsEm/8J8c2ZG8xuEeKvZ/VmAqebo=
+109
-1
5 changed files
expand all
collapse all
unified
split
.chezmoiexternal.toml
dot_config
kitty
kitty.conf
private_Library
private_Application Support
nushell
config.nu
env.nu
run_nushell_generation.nu
+6
.chezmoiexternal.toml
···
1
1
+
[".cache/nu_scripts"]
2
2
+
type = "archive"
3
3
+
url = "https://github.com/nushell/nu_scripts/archive/refs/heads/main.tar.gz"
4
4
+
exact = true
5
5
+
stripComponents = 1
6
6
+
refreshPeriod = "168h"
+1
-1
dot_config/kitty/kitty.conf
···
9
9
10
10
confirm_os_window_close 0
11
11
12
12
-
shell xonsh
12
12
+
shell nu
13
13
14
14
# BEGIN_KITTY_THEME
15
15
# Catppuccin-Latte
+6
private_Library/private_Application Support/nushell/config.nu
···
1
1
+
let-env config = ($env.config | upsert show_banner false)
2
2
+
let-env config = ($env.config | upsert rm.always_trash true)
3
3
+
let-env config = ($env.config | upsert edit_mode vi)
4
4
+
let-env config = ($env.config | upsert history.max_size 100000)
5
5
+
let-env config = ($env.config | upsert footer_mode auto)
6
6
+
let-env config = ($env.config | upsert history.file_format "sqlite")
+84
private_Library/private_Application Support/nushell/env.nu
···
1
1
+
# Nushell Environment Config File
2
2
+
3
3
+
### Load standardised prompt "starship"
4
4
+
# TEMP: Custom vi prompt indicators
5
5
+
let-env PROMPT_INDICATOR_VI_INSERT = ""
6
6
+
let-env PROMPT_INDICATOR_VI_NORMAL = ""
7
7
+
source ~/.cache/starship/init.nu
8
8
+
9
9
+
# Specifies how environment variables are:
10
10
+
# - converted from a string to a value on Nushell startup (from_string)
11
11
+
# - converted from a value back to a string when running external commands (to_string)
12
12
+
# Note: The conversions happen *after* config.nu is loaded
13
13
+
let-env ENV_CONVERSIONS = {
14
14
+
"PATH": {
15
15
+
from_string: { |s| $s | split row (char esep) | path expand --no-symlink }
16
16
+
to_string: { |v| $v | path expand --no-symlink | str join (char esep) }
17
17
+
}
18
18
+
}
19
19
+
20
20
+
# Directories to search for scripts when calling source or use
21
21
+
#
22
22
+
# By default, <nushell-config-dir>/scripts is added
23
23
+
let-env NU_LIB_DIRS = [ ($nu.default-config-dir | path join 'scripts') ]
24
24
+
25
25
+
# Directories to search for plugin binaries when calling register
26
26
+
#
27
27
+
# By default, <nushell-config-dir>/plugins is added
28
28
+
let-env NU_PLUGIN_DIRS = [ ($nu.default-config-dir | path join 'plugins') ]
29
29
+
30
30
+
31
31
+
# Add entries to PATH:
32
32
+
# From MacOS helper (/usr/libexec/path_helper)
33
33
+
let-env PATH = ($env.PATH | split row (char esep) | append "/Library/TeX/texbin")
34
34
+
let-env PATH = ($env.PATH | split row (char esep) | append "/Library/Apple/usr/bin")
35
35
+
let-env PATH = ($env.PATH | split row (char esep) | append "/opt/homebrew/bin")
36
36
+
let-env PATH = ($env.PATH | split row (char esep) | append "/opt/homebrew/sbin")
37
37
+
let-env PATH = ($env.PATH | split row (char esep) | append "/usr/local/bin")
38
38
+
# Optional Homebrew packages
39
39
+
let-env PATH = ($env.PATH | split row (char esep) | prepend $"(brew --prefix | str trim)/opt/bison/bin")
40
40
+
let-env PATH = ($env.PATH | split row (char esep) | prepend $"(brew --prefix | str trim)/opt/flex/bin")
41
41
+
let-env PATH = ($env.PATH | split row (char esep) | prepend $"(brew --prefix | str trim)/opt/llvm/bin")
42
42
+
let-env PATH = ($env.PATH | split row (char esep) | prepend $"(brew --prefix | str trim)/opt/openjdk/bin")
43
43
+
# Other package managers
44
44
+
let-env PATH = ($env.PATH | split row (char esep) | prepend $"($env.HOME)/.local/bin")
45
45
+
let-env PATH = ($env.PATH | split row (char esep) | prepend $"($env.HOME)/.cargo/bin")
46
46
+
47
47
+
# --- user custom ---
48
48
+
# Set default editor
49
49
+
let-env EDITOR = "nvim"
50
50
+
let-env VISUAL = "codium"
51
51
+
# Alias for Monash compute cluster
52
52
+
let-env OPTCLUSTER = "compute.optimisation-2020.cloud.edu.au"
53
53
+
# CMake settings
54
54
+
let-env CMAKE_EXPORT_COMPILE_COMMANDS = "1" # output compile-commands.json for clangd
55
55
+
let-env CMAKE_GENERATOR = "Ninja Multi-Config" # use Ninja generator by default
56
56
+
let-env CMAKE_C_COMPILER_LAUNCHER = "ccache"
57
57
+
let-env CMAKE_CXX_COMPILER_LAUNCHER = "ccache"
58
58
+
# Homebrew shell setup (brew shellenv)
59
59
+
let-env HOMEBREW_PREFIX = "/opt/homebrew"
60
60
+
let-env HOMEBREW_CELLAR = "/opt/homebrew/Cellar"
61
61
+
let-env HOMEBREW_REPOSITORY = "/opt/homebrew"
62
62
+
let-env INFOPATH = "/opt/homebrew/share/info"
63
63
+
# Set MANPATH
64
64
+
let-env MANPATH = "/usr/share/man:/usr/local/share/man:/Library/TeX/Distributions/.DefaultTeX/Contents/Man:/opt/homebrew/share/man"
65
65
+
66
66
+
### Setup aliases
67
67
+
alias edit = ^($env.VISUAL)
68
68
+
alias start = ^open
69
69
+
alias less = bat
70
70
+
alias set-light-theme = kitty +kitten themes Catppuccin-Latte
71
71
+
alias set-dark-theme = kitty +kitten themes Catppuccin-Macchiato
72
72
+
alias brew-backup = brew bundle dump --global --no-lock --cask --mas --tap --force
73
73
+
alias brew-cleanup = brew bundle cleanup --global --no-lock --force --zap
74
74
+
alias brew-restore = brew bundle install --global --no-lock
75
75
+
76
76
+
# Load autojump plugin "zoxide"
77
77
+
source ~/.cache/zoxide/zoxide.nu
78
78
+
79
79
+
# Load completions
80
80
+
source ~/.cache/nu_scripts/custom-completions/cargo/cargo-completions.nu
81
81
+
source ~/.cache/nu_scripts/custom-completions/git/git-completions.nu
82
82
+
source ~/.cache/nu_scripts/custom-completions/make/make-completions.nu
83
83
+
source ~/.cache/nu_scripts/custom-completions/npm/npm-completions.nu
84
84
+
source ~/.cache/nu_scripts/custom-completions/typst/typst-completions.nu
+12
run_nushell_generation.nu
···
1
1
+
#!/usr/bin/env nu
2
2
+
3
3
+
# Generate zoxide configuration
4
4
+
if (which zoxide | is-empty) == false {
5
5
+
mkdir ~/.cache/zoxide/
6
6
+
zoxide init nushell --hook prompt | save --force ~/.cache/zoxide/zoxide.nu
7
7
+
}
8
8
+
9
9
+
if (which starship | is-empty) == false {
10
10
+
mkdir ~/.cache/starship/
11
11
+
starship init nu | save --force ~/.cache/starship/init.nu
12
12
+
}