talira

A faster cd that learns which directories you use and jumps to them from a few letters.

open sourceMITself-hostablefree

z.lua tracks the directories you visit and ranks them by frecency (how often and how recently), so z foo bar takes you to the best match for every word you type, in order. It can pick the highest-ranked or most recent match, limit matches to below the current directory, list matches, let you choose interactively or through fzf, and jump back to a parent directory or the project root without typing cd ../../... It's a single Lua script for bash, zsh, dash, ksh, busybox and other POSIX shells, Fish, Nushell, PowerShell and Windows cmd through clink, and it says it's 10 times faster than fasd and autojump and 3 times faster than z.sh, with an optional native module in C. Similar to zoxide.

Problems it solves

  • jump to a directory I use often without typing its full path
  • cd ../../.. to get back to the project root is tedious
  • autojump makes my shell slow to start
  • a z.sh replacement that works on Windows and PowerShell
  • pick from matching directories with fzf before changing directory
  • smarter cd that learns my habits

Features

  • frecency ranking of visited directories
  • match all given words or regexes in order
  • rank-only or recency-only matching
  • restrict to subdirectories of the current directory
  • interactive selection and fzf integration
  • jump back to a parent or the project root
  • optional enhanced matching
  • excluded directories and aging threshold
  • bash, zsh, POSIX shells, Fish, Nushell, PowerShell and Windows cmd
  • optional native module in C

Limitations

  • Needs Lua 5.1 or later, or LuaJIT, installed.1

Capabilities

Has a command line toolplan not known

Alternatives

The same job

These do what z.lua does.

  1. zoxide A smarter cd command. Supports all major shells.

Compare z.lua with the top 3