diff --git a/modules/home/shell-conf.nix b/modules/home/shell-conf.nix index d2b8c50..1bdff5f 100644 --- a/modules/home/shell-conf.nix +++ b/modules/home/shell-conf.nix @@ -87,7 +87,6 @@ television bash-env-json bash-env-nushell - nufmt vivid caddy diff --git a/modules/home/shell-conf/nushell/config.nu b/modules/home/shell-conf/nushell/config.nu index a5a8426..d784ad0 100644 --- a/modules/home/shell-conf/nushell/config.nu +++ b/modules/home/shell-conf/nushell/config.nu @@ -1,5 +1,4 @@ -$env.config.completions.external.completer = $fish_completer $env.LS_COLORS = (vivid generate one-dark) # $env.NH_FLAKE = $env.HOME + "/nixos-config/" @@ -13,10 +12,6 @@ def --env doomup [...args] { systemctl --user restart emacs.service } -# def --env pullall [] { - -# } - def pdf-compress [...args] { gs -sDEVICE=pdfwrite -dPDFSETTINGS=/printer -dNOPAUSE -dBATCH -sOutputFile=output.pdf $args } diff --git a/modules/home/shell-conf/nushell/env.nu b/modules/home/shell-conf/nushell/env.nu index cb2d3ca..eedf473 100644 --- a/modules/home/shell-conf/nushell/env.nu +++ b/modules/home/shell-conf/nushell/env.nu @@ -1,20 +1,19 @@ - let fish_completer = {|spans| - let completions = fish --command $'complete "--do-complete=($spans | str join " ")"' - | from tsv --flexible --noheaders --no-infer - | rename value description +let fish_completer = {|spans| + let completions = fish --command $'complete "--do-complete=($spans | str join " ")"' + | from tsv --flexible --noheaders --no-infer + | rename value description - let has_paths = ($completions | any {|row| $row.value =~ '/' or $row.value =~ '\\.\\w+$' or $row.value =~ ' '}) - - if $has_paths { - $completions | update value {|row| - if $row.value =~ ' ' { - $"'($row.value)'" # Wrap in single quotes - } else { - $row.value - } - } - } else { - $completions - } - } + let has_paths = ($completions | any {|row| $row.value =~ '/' or $row.value =~ '\\.\\w+$' or $row.value =~ ' '}) + if $has_paths { + $completions | update value {|row| + if $row.value =~ ' ' { + $"'($row.value)'" # Wrap in single quotes + } else { + $row.value + } + } + } else { + $completions + } +}