aboutsummaryrefslogtreecommitdiff
path: root/dot_config/nushell
diff options
context:
space:
mode:
authortwells46 <173561638+twells46@users.noreply.github.com>2025-12-31 13:28:05 -0600
committertwells46 <173561638+twells46@users.noreply.github.com>2025-12-31 13:28:05 -0600
commit2140ab51deed88e90eafebf9520fa5f9995dc7c9 (patch)
tree03cf1dcd2900495c1efb79aaa85f3254ecd5fb87 /dot_config/nushell
parentff8f50638e4b17a9d7cc88d2f0d9560b7effce39 (diff)
Migrate from stow
Diffstat (limited to 'dot_config/nushell')
-rw-r--r--dot_config/nushell/autoload/01_carapace.nu3
-rw-r--r--dot_config/nushell/autoload/02_carapace.nu1
-rw-r--r--dot_config/nushell/autoload/completer.nu56
-rw-r--r--dot_config/nushell/autoload/lfcd.nu4
-rw-r--r--dot_config/nushell/config.nu26
-rw-r--r--dot_config/nushell/env.nu18
6 files changed, 108 insertions, 0 deletions
diff --git a/dot_config/nushell/autoload/01_carapace.nu b/dot_config/nushell/autoload/01_carapace.nu
new file mode 100644
index 0000000..42d9073
--- /dev/null
+++ b/dot_config/nushell/autoload/01_carapace.nu
@@ -0,0 +1,3 @@
+$env.CARAPACE_BRIDGES = 'zsh,fish,bash,inshellisense' # optional
+mkdir $"($nu.cache-dir)"
+carapace _carapace nushell | save --force $"($nu.cache-dir)/carapace.nu"
diff --git a/dot_config/nushell/autoload/02_carapace.nu b/dot_config/nushell/autoload/02_carapace.nu
new file mode 100644
index 0000000..b0ceba6
--- /dev/null
+++ b/dot_config/nushell/autoload/02_carapace.nu
@@ -0,0 +1 @@
+source $"($nu.cache-dir)/carapace.nu"
diff --git a/dot_config/nushell/autoload/completer.nu b/dot_config/nushell/autoload/completer.nu
new file mode 100644
index 0000000..910305e
--- /dev/null
+++ b/dot_config/nushell/autoload/completer.nu
@@ -0,0 +1,56 @@
+#let fish_completer = {|spans|
+# fish --command $"complete '--do-complete=($spans | str replace --all "'" "\\'" | str join ' ')'"
+# | from tsv --flexible --noheaders --no-infer
+# | rename value description
+# | update value {|row|
+# let value = $row.value
+# let need_quote = ['\' ',' '[' ']' '(' ')' ' ' '\t' "'" '"' "`"] | any {$in in $value}
+# if ($need_quote and ($value | path exists)) {
+# let expanded_path = if ($value starts-with ~) {$value | path expand --no-symlink} else {$value}
+# $'"($expanded_path | str replace --all "\"" "\\\"")"'
+# } else {$value}
+# }
+#}
+#
+#
+#let carapace_completer = {|spans: list<string>|
+# carapace $spans.0 nushell ...$spans
+# | from json
+# | if ($in | default [] | any {|| $in.display | str starts-with "ERR"}) { null } else { $in }
+#}
+#
+## This completer will use carapace by default
+#let external_completer = {|spans|
+# let expanded_alias = scope aliases
+# | where name == $spans.0
+# | get -o 0.expansion
+#
+# let spans = if $expanded_alias != null {
+# $spans
+# | skip 1
+# | prepend ($expanded_alias | split row ' ' | take 1)
+# } else {
+# $spans
+# }
+#
+# match $spans.0 {
+# # carapace completions are incorrect for nu
+# nu => $fish_completer
+# # fish completes commits and branch names in a nicer way
+# git => $fish_completer
+# # carapace doesn't have completions for asdf
+# asdf => $fish_completer
+# _ => $carapace_completer
+# } | do $in $spans
+#}
+#
+#$env.config = {
+# # ...
+# completions: {
+# external: {
+# enable: true
+# completer: $external_completer
+# }
+# }
+# # ...
+#}
diff --git a/dot_config/nushell/autoload/lfcd.nu b/dot_config/nushell/autoload/lfcd.nu
new file mode 100644
index 0000000..d850902
--- /dev/null
+++ b/dot_config/nushell/autoload/lfcd.nu
@@ -0,0 +1,4 @@
+alias lf-default = lf
+def --env --wrapped lf [...argv] {
+ cd (lf-default -print-last-dir ...$argv)
+}
diff --git a/dot_config/nushell/config.nu b/dot_config/nushell/config.nu
new file mode 100644
index 0000000..4e49315
--- /dev/null
+++ b/dot_config/nushell/config.nu
@@ -0,0 +1,26 @@
+# config.nu
+#
+# Installed by:
+# version = "0.109.1"
+#
+# This file is used to override default Nushell settings, define
+# (or import) custom commands, or run any other startup tasks.
+# See https://www.nushell.sh/book/configuration.html
+#
+# Nushell sets "sensible defaults" for most configuration settings,
+# so your `config.nu` only needs to override these defaults if desired.
+#
+# You can open this file in your default editor using:
+# config nu
+#
+# You can also pretty-print and page through the documentation for configuration
+# options using:
+# config nu --doc | nu-highlight | less -R
+
+$env.config.history.file_format = "sqlite"
+
+$env.config.show_banner = false
+
+$env.PROMPT_COMMAND_RIGHT = ""
+
+$env.LS_COLORS = (vivid generate catppuccin-latte)
diff --git a/dot_config/nushell/env.nu b/dot_config/nushell/env.nu
new file mode 100644
index 0000000..a9ac563
--- /dev/null
+++ b/dot_config/nushell/env.nu
@@ -0,0 +1,18 @@
+# env.nu
+#
+# Installed by:
+# version = "0.109.1"
+#
+# Previously, environment variables were typically configured in `env.nu`.
+# In general, most configuration can and should be performed in `config.nu`
+# or one of the autoload directories.
+#
+# This file is generated for backwards compatibility for now.
+# It is loaded before config.nu and login.nu
+#
+# See https://www.nushell.sh/book/configuration.html
+#
+# Also see `help config env` for more options.
+#
+# You can remove these comments if you want or leave
+# them for future reference.