lacy

Crates.iolacy
lib.rslacy
version0.5.0
created_at2024-11-12 20:08:42.252664+00
updated_at2025-09-15 12:36:18.190941+00
descriptionFast magical cd alternative for lazy terminal navigators
homepagehttps://github.com/timothebot/lacy
repositoryhttps://github.com/timothebot/lacy
max_upload_size
id1445470
size1,482,817
tiimo (timothebot)

documentation

README

Lacy

lacy banner
Crates.io Version Crates.io Total Downloads GitHub Repo stars

Lacy is a magical cd alternative that makes navigating much more efficient!

If you are interested, please consider ⭐-ing this repo so I know that more people are interested!

# Instead of 'cd Desktop/projects/lacy/src'
y desk prj lacy src

# or 
y - - layc src

# or 
y Desktop/prj layc sc

Features

Navigation without full path

You don't have to type the full directory name. Just make sure the path matches the directory name more or less.

# normal cd
cd /Users/timothebot/projects/lacy/src

# with lacy
y / user timo prj lacy sr
# or
y / usrs timbo rojt layc rc

Skipping directories

Forgot the directory name? No problem. Just skip it using -.

y / user timo - lacy sr

# as long as some parts are still unique, it will work
# ...and it's very fast
y / - - - lacy sr

Like cd

Everything you can do with cd, you can do with y.

y /Users/timo/Projects/Lacy/src
y ~
y ..

Real paths

You can also add real paths while lazy navigating.

y /Users/timo/ desk proj lacy/src

Getting started

Installation

Cargo (Universal)

cargo install lacy

Homebrew (macOS)

brew install timothebot/tap/lacy

NixOS (with Flakes and Home Manager) ❄️

There are a couple of ways to get lacy up and running on your Nix system. Both methods require adding lacy to your flake.nix inputs.

# flake.nix
{
  inputs = {
    lacy.url = "github:timothebot/lacy";
    # ... other inputs
  };

  outputs = { self, nixpkgs, lacy, ... }@inputs: {
    # ...
  };
}
1. Home Manager Module (Recommended)

This is the easiest way to manage lacy if you're using Home Manager. The module handles most of the setup for you. You must explicitly add the lacy flake as an overlay to your configuration to ensure the lacy package is available.

# home.nix
{ pkgs, inputs, ... }: {
  # Explicitly add the overlay to make lacy visible in your pkgs set
  nixpkgs.overlays = [ inputs.lacy.overlays.default ];

  imports = [
    inputs.lacy.homeManagerModules.default
  ];

  programs.lacy.enable = true;
}
2. Nix Overlay (NixOS / Home Manager)

If you prefer to manage packages directly without using the Home Manager module, this is the way to go. You apply the overlay and then add the lacy package to your system or user packages.

For NixOS:

# In your NixOS configuration (e.g., /etc/nixos/configuration.nix)
{ pkgs, inputs, ... }: {
  nixpkgs.overlays = [ inputs.lacy.overlays.default ];

  environment.systemPackages = [ pkgs.lacy ];
}

For Home Manager:

# In your home-manager configuration (e.g., ~/.config/nixpkgs/home.nix)
{ pkgs, inputs, ... }: {
  nixpkgs.overlays = [ inputs.lacy.overlays.default ];

  home.packages = [ pkgs.lacy ];
}
3. Run lacy directly

Just want to try it out? You can run lacy from the command line without adding it to your system configuration.

nix run github:timothebot/lacy

Shell Setup

For more shell options, see lacy init --help.

Zsh

# ~/.zshrc
eval "$(lacy init zsh)"

Bash

# ~/.bashrc
eval "$(lacy init bash)"

Fish

# ~/.config/fish/config.fish
lacy init fish | source

Other shells

Feel free to contribute the init script for your preferred shell.

FAQ

Why does it need a shell script?

It is needed because you can't change the directory without using cd. So the shell script just executes cd if needed.

Isn't it faster to use completions?

Yes. And no. Completions break, if you have a lot of similar named directories.

project_server/
project_web/
project_types/

For example, in this structure, you can just type y web instead.

Why not z/zoxide?

z is a great tool, but if you are working with a lot of projects with similar paths, it can be a pain to navigate. z also needs to learn first, while lacy can be used on systems you (or lacy) never touched before. You can use z alongside lacy.

How can I use both Lacy and z/zoxide?

If you have cd aliased to z, then it should work as long as the Lacy shell eval is below the z eval. If not, run lacy init <shell> and manually add the result to your shell config. Then, replace the cd's with z.

I have other problems and need help!

Feel free to open an issue, contact me on discord (@tiimo, DM me, don't send friend requests).

Contributions

Feel free to open a PR for any type of changes!

AI notice

The code in this repository was written by hand. AI was used for the different shell configurations and helped with the Github actions.


Built with <3 by timothebot

Commit count: 97

cargo fmt