diff --git a/CHANGELOG b/CHANGELOG
index a26027c..34698ce 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [0.7.0] - 2026-04-01
+
+### Added
+
+- Nushell support
+- Powershell support
+
+### Fixed
+
+- Fish integration autocomplete now works as intended
+
## [0.6.1] - 2026-01-18
### Fixed
diff --git a/Cargo.lock b/Cargo.lock
index 6cb4fb0..4ee53db 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4,9 +4,9 @@ version = 4
[[package]]
name = "anstream"
-version = "0.6.18"
+version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b"
+checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d"
dependencies = [
"anstyle",
"anstyle-parse",
@@ -19,15 +19,15 @@ dependencies = [
[[package]]
name = "anstyle"
-version = "1.0.10"
+version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9"
+checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000"
[[package]]
name = "anstyle-parse"
-version = "0.2.6"
+version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9"
+checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e"
dependencies = [
"utf8parse",
]
@@ -80,9 +80,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
[[package]]
name = "clap"
-version = "4.5.48"
+version = "4.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2134bb3ea021b78629caa971416385309e0131b351b25e01dc16fb54e1b5fae"
+checksum = "b193af5b67834b676abd72466a96c1024e6a6ad978a1f484bd90b85c94041351"
dependencies = [
"clap_builder",
"clap_derive",
@@ -90,9 +90,9 @@ dependencies = [
[[package]]
name = "clap_builder"
-version = "4.5.48"
+version = "4.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c2ba64afa3c0a6df7fa517765e31314e983f51dda798ffba27b988194fb65dc9"
+checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f"
dependencies = [
"anstream",
"anstyle",
@@ -102,9 +102,9 @@ dependencies = [
[[package]]
name = "clap_derive"
-version = "4.5.47"
+version = "4.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bbfd7eae0b0f1a6e63d4b13c9c478de77c2eb546fba158ad50b4203dc24b9f9c"
+checksum = "1110bd8a634a1ab8cb04345d8d878267d57c3cf1b38d91b71af6686408bbca6a"
dependencies = [
"heck",
"proc-macro2",
@@ -114,9 +114,9 @@ dependencies = [
[[package]]
name = "clap_lex"
-version = "0.7.5"
+version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675"
+checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9"
[[package]]
name = "colorchoice"
@@ -139,9 +139,9 @@ dependencies = [
[[package]]
name = "ctrlc"
-version = "3.5.1"
+version = "3.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "73736a89c4aff73035ba2ed2e565061954da00d4970fc9ac25dcc85a2a20d790"
+checksum = "e0b1fab2ae45819af2d0731d60f2afe17227ebb1a1538a236da84c93e9a60162"
dependencies = [
"dispatch2",
"nix",
@@ -220,7 +220,7 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
[[package]]
name = "lacy"
-version = "0.6.1"
+version = "0.7.0"
dependencies = [
"clap",
"ctrlc",
@@ -231,21 +231,21 @@ dependencies = [
[[package]]
name = "libc"
-version = "0.2.176"
+version = "0.2.183"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "58f929b4d672ea937a23a1ab494143d968337a5f47e56d0815df1e0890ddf174"
+checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d"
[[package]]
name = "linux-raw-sys"
-version = "0.11.0"
+version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039"
+checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
[[package]]
name = "nix"
-version = "0.30.1"
+version = "0.31.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6"
+checksum = "5d6d0705320c1e6ba1d912b5e37cf18071b6c2e9b7fa8215a1e8a7651966f5d3"
dependencies = [
"bitflags",
"cfg-if",
@@ -276,18 +276,18 @@ checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
[[package]]
name = "proc-macro2"
-version = "1.0.89"
+version = "1.0.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e"
+checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
-version = "1.0.37"
+version = "1.0.45"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
+checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
dependencies = [
"proc-macro2",
]
@@ -300,9 +300,9 @@ checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
[[package]]
name = "rustix"
-version = "1.1.2"
+version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e"
+checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190"
dependencies = [
"bitflags",
"errno",
@@ -345,9 +345,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = "syn"
-version = "2.0.87"
+version = "2.0.117"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d"
+checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
dependencies = [
"proc-macro2",
"quote",
@@ -356,9 +356,9 @@ dependencies = [
[[package]]
name = "tempfile"
-version = "3.23.0"
+version = "3.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16"
+checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
dependencies = [
"fastrand",
"getrandom",
diff --git a/Cargo.toml b/Cargo.toml
index faec2c5..14657ff 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "lacy"
description = "Fast magical cd alternative for lazy terminal navigators"
-version = "0.6.1"
+version = "0.7.0"
authors = ["timothebot"]
repository = "https://github.com/timothebot/lacy"
homepage = "https://github.com/timothebot/lacy"
@@ -17,13 +17,13 @@ categories = ["command-line-utilities"]
keywords = ["cli", "tool", "utility"]
[dependencies]
-clap = { version = "4.5.48", features = ["derive"] }
-ctrlc = { version = "3.5.1", features = ["termination"] }
+clap = { version = "4.6.0", features = ["derive"] }
+ctrlc = { version = "3.5.2", features = ["termination"] }
dialoguer = "0.12.0"
upon = "0.10.0"
[dev-dependencies]
-tempfile = "3.23.0"
+tempfile = "3.27.0"
[profile.release]
codegen-units = 1
diff --git a/README.md b/README.md
index f905d8f..87d587a 100644
--- a/README.md
+++ b/README.md
@@ -98,6 +98,19 @@ lacy init fish | source
+
+Nushell
+
+You can't set the lacy alias (`--cmd`) to `cd`. More infos below the table at [Shell Options](https://lacy.tiimo.space/setup.html#shell-options).
+
+```bash
+# $nu.config-path
+mkdir ($nu.data-dir | path join "vendor/autoload")
+lacy init nu | save -f ($nu.data-dir | path join "vendor/autoload/lacy.nu")
+```
+
+
+
PowerShell
diff --git a/docs/src/setup.md b/docs/src/setup.md
index e9634b4..dc3f1d0 100644
--- a/docs/src/setup.md
+++ b/docs/src/setup.md
@@ -27,6 +27,16 @@ eval "$(lacy init bash)"
lacy init fish | source
```
+### Nushell
+
+You can't set the lacy alias (`--cmd`) to `cd`. More infos at [`--cmd`](#--cmd).
+
+```bash
+# $nu.config-path
+mkdir ($nu.data-dir | path join "vendor/autoload")
+lacy init nu | save -f ($nu.data-dir | path join "vendor/autoload/lacy.nu")
+```
+
### PowerShell
```powershell
@@ -42,8 +52,29 @@ Feel free to contribute the init script for your preferred shell.
You can customize the shell script that gets generated by using these options:
-| Option | Default | Description |
-| ------ | ------- | ----------- |
-| `--cd-cmd` | `builtin cd` | Define the command to be used instead of `cd`. (e.g. `--cd-cmd=z`) |
-| `--cmd`| `y` | The name of the main lacy command you use for navigating. (e.g. `--cmd=cd`) |
-| `--custom-fuzzy` | *none* | Configure this to disable lacy's built in UI selector and replace it with your own command. (e.g. `--custom-fuzzy=fzf`) |
+### `--cd-cmd`
+
+Define the command to be used instead of `cd`. (e.g. `--cd-cmd=z`)
+
+Default:
+
+- Bash, ZSH, Fish: `builtin cd`
+- Nushell: `cd`
+- PowerShell: `Set-Location`
+
+### `--cmd`
+
+The name of the main lacy command you use for navigating. (e.g. `--cmd=cd`)
+
+Default: `y`
+
+> [!WARNING]
+> Nushell doesn't have a `builtin cd` option,
+> so setting it `--cmd=cd` will cause a loop.
+> It should be possible to bypass this with some tinkering ([issue in nushell repo](https://github.com/nushell/nushell/issues/3792)). Feel free to open a PR if you have a good solution!
+
+### `--custom-fuzzy`
+
+Configure this to disable lacy's built in UI selector and replace it with your own command. (e.g. `--custom-fuzzy=fzf`)
+
+Default: *none*
diff --git a/flake.nix b/flake.nix
index 1a53960..a9f976d 100644
--- a/flake.nix
+++ b/flake.nix
@@ -31,7 +31,7 @@
passthru.updateScript = nix-update-script { };
- cargoHash = "sha256-OJW29CopdO7lbkr0F2KVnfbRGEGIf8J8Vu8YChjeElY=";
+ cargoHash = "sha256-3K8g/AGpSXFUhgEBg/AzUYsH3vOvsRzAYnrOAZNVS4g=";
meta = {
description = "Fast magical cd alternative for lacy terminal navigators";
diff --git a/src/cmd/commands.rs b/src/cmd/commands.rs
index f6e6039..4a738b2 100644
--- a/src/cmd/commands.rs
+++ b/src/cmd/commands.rs
@@ -74,11 +74,14 @@ $ echo \"eval \\\"\\$(lacy init bash)\\\"\" >> ~/.bashrc
Fish:
$ echo \"lacy init fish | source\" >> ~/.config/fish/config.fish
+Nu (check docs before updating init options for nu):
+$ echo r#'mkdir ($nu.data-dir | path join \"vendor/autoload\"); lacy init nu | save -f ($nu.data-dir | path join \"vendor/autoload/lacy.nu\")'# o>> $nu.config-path
+
PowerShell:
$ echo \"lacy init powershell | Out-String | iex\" >> $PROFILE"
)]
pub struct Init {
- /// Currently supported shells: bash, fish, zsh, powershell
+ /// Currently supported shells: bash, fish, zsh, nu, powershell
pub shell: String,
/// Allows you to specify another command than cd, e.g. z
diff --git a/src/cmd/init.rs b/src/cmd/init.rs
index dea79ab..616f5e6 100644
--- a/src/cmd/init.rs
+++ b/src/cmd/init.rs
@@ -30,12 +30,15 @@ pub fn shell_config(
let _ = engine.add_template("bash", include_str!("../../templates/bash.sh"));
let _ = engine.add_template("zsh", include_str!("../../templates/zsh.sh"));
let _ = engine.add_template("fish", include_str!("../../templates/fish.fish"));
+ let _ = engine.add_template("nu", include_str!("../../templates/nu.nu"));
let _ = engine.add_template("powershell", include_str!("../../templates/powershell.ps1"));
// Overwrite the default cd_cmd for certain shells
let cd_cmd = if cd_cmd == "builtin cd" {
match shell {
"powershell" => "Set-Location",
+ // Nushell does not have a builtin command
+ "nu" => "cd",
_ => cd_cmd,
}
} else {
@@ -74,6 +77,9 @@ mod tests {
engine
.add_template("fish", include_str!("../../templates/fish.fish"))
.unwrap();
+ engine
+ .add_template("nu", include_str!("../../templates/nu.nu"))
+ .unwrap();
engine
.add_template("powershell", include_str!("../../templates/powershell.ps1"))
.unwrap();
diff --git a/templates/nu.nu b/templates/nu.nu
new file mode 100644
index 0000000..ddec39c
--- /dev/null
+++ b/templates/nu.nu
@@ -0,0 +1,43 @@
+# START generated Lacy shell config
+module lacy {
+ def lacy-query-to-completion [context: string] {
+ let query = ($context | split row " " | skip 1 | str join " ")
+ if $query == "" {
+ return (ls -a | where type == dir | get name)
+ }
+ if $context ends-with " " {
+ return (lacy complete --basename -- $"($query) " | split row " " | uniq)
+ }
+ return (lacy complete --basename -- $query | split row " " | uniq)
+ }
+
+ def lacy-dir-names [context: string] {
+ {
+ options: {
+ case_sensitive: false,
+ completion_algorithm: fuzzy,
+ sort: false,
+ },
+ completions: (lacy-query-to-completion $context)
+ }
+ }
+
+ export def --env {{ lacy_cmd }} [...args: string@lacy-dir-names] {
+ let query = ($args | str join " ")
+ let new_path = (lacy prompt {{ return_all }}-- $"($query)")
+ if $new_path == "~" {
+ {{ cd }} ~
+ {% if custom_fuzzy.enabled %} } else if ($new_path | str contains "\n") {
+ let selected = ($new_path | {{ custom_fuzzy.cmd }})
+ if ($selected | path exists) and ($selected | path type) == "dir" {
+ {{ cd }} $selected
+ }
+ {% endif %} } else if ($new_path | path exists) and ($new_path | path type) == "dir" {
+ {{ cd }} $new_path
+ } else {
+ print $"Error: No matching directory found for '($query)'"
+ }
+ }
+}
+use lacy {{ lacy_cmd }}
+# END generated Lacy shell config