diff --git a/flake.lock b/flake.lock index 3a44cdb..9460c91 100644 --- a/flake.lock +++ b/flake.lock @@ -541,11 +541,11 @@ ] }, "locked": { - "lastModified": 1751239699, - "narHash": "sha256-zA1uUdAq3c26fHm26xMWMuF5COhI18EzaH7az/P2OWM=", + "lastModified": 1751296747, + "narHash": "sha256-/nHOfmB0C972nYX0xVF0zWmbt8ooA9TCczfeKHNvwqI=", "owner": "nix-community", "repo": "home-manager", - "rev": "f6deff178cc4d6049d30785dbfc831e6c6e3a219", + "rev": "0f21ed5182a158d2f84e9136f6bf8539fd9a6890", "type": "github" }, "original": { @@ -1578,11 +1578,11 @@ "rust-overlay": "rust-overlay_3" }, "locked": { - "lastModified": 1751272045, - "narHash": "sha256-4h+pRl1IxnvS3jPqkommNFMn9alzNEAW99v6vdBlPkI=", + "lastModified": 1751296710, + "narHash": "sha256-SWKkSaqzVmHi+AnGc706tkvqobDMyYnXifeLTb//pnw=", "owner": "sxyazi", "repo": "yazi", - "rev": "5a66559d1ca53db3869384a8039bbe82a2ca2dbd", + "rev": "4ff7dae7211a53c3d60f512a39d12425a1b9496c", "type": "github" }, "original": { diff --git a/modules/home/shell-conf.nix b/modules/home/shell-conf.nix index f3ac747..b0fe4ae 100644 --- a/modules/home/shell-conf.nix +++ b/modules/home/shell-conf.nix @@ -94,9 +94,14 @@ television bash-env-json bash-env-nushell + nufmt + ]; programs = { + carapace = { + enable = true; + }; bash = { enable = true; }; diff --git a/modules/home/shell-conf/fish/fish.nix b/modules/home/shell-conf/fish/fish.nix index b4a6011..9b65898 100644 --- a/modules/home/shell-conf/fish/fish.nix +++ b/modules/home/shell-conf/fish/fish.nix @@ -5,11 +5,13 @@ enable = true; shellAliases = { "em" = "emacsclient -n -r"; + "emm" = "emacsclient -nw"; "mkdir" = "mkdir -pv"; "gtr" = "gtrash restore"; "rmr" = "gtrash restore"; "rm" = "gtrash put"; "lg" = "lazygit"; + "cat" = "bat --plain"; }; # change fzf variable search to C-M-v diff --git a/modules/home/shell-conf/nushell/config.nu b/modules/home/shell-conf/nushell/config.nu index 764ff58..8b13789 100644 --- a/modules/home/shell-conf/nushell/config.nu +++ b/modules/home/shell-conf/nushell/config.nu @@ -1,8 +1 @@ -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 { - if ($in | path exists) {$'"($in | path expand --no-symlink | str replace --all "\"" "\\\"" )"'} else {$in} - } -} + diff --git a/modules/home/shell-conf/nushell/nushell.nix b/modules/home/shell-conf/nushell/nushell.nix index c01aba7..1a22af6 100644 --- a/modules/home/shell-conf/nushell/nushell.nix +++ b/modules/home/shell-conf/nushell/nushell.nix @@ -5,10 +5,12 @@ enable = true; shellAliases = { "em" = "emacsclient -n -r"; + "emm" = "emacsclient -nw"; "gtr" = "gtrash restore"; "rmr" = "gtrash restore"; "rm" = "gtrash put"; "lg" = "lazygit"; + "cat" = "bat --plain"; }; configFile.source = ./config.nu; loginFile.text = '' @@ -22,6 +24,43 @@ }; settings = { show_banner = false; + ls = { clickable_links = true; }; + completions = { + case_sensitive = false; + quick = true; + partial = true; + algorithm = "fuzzy"; + external = { + enable = true; + max_results = 100; + }; + }; }; + extraConfig = '' + $env.config.completions.external.completer = $fish_completer + ''; + + extraEnv = '' + 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 + } + } + ''; + # plugins = [ pkgs.nushellPlugins.skim ]; }; }