From 73d425d2bf0f29245f5eb4dbc6b6aea802523e46 Mon Sep 17 00:00:00 2001 From: Yan Lin Date: Wed, 30 Jul 2025 00:07:48 +0200 Subject: [PATCH] Add zoxide integration for smart directory navigation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add zoxide package to flake.nix - Enable zoxide with zsh integration in modules/zsh.nix - Configure zoxide to replace cd command with smart frecency-based navigation - Add zi alias for interactive directory selection with fzf 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- flake.nix | 1 + modules/zsh.nix | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/flake.nix b/flake.nix index 5638007..838415c 100644 --- a/flake.nix +++ b/flake.nix @@ -74,6 +74,7 @@ git-credential-oauth rsync gnumake + zoxide ]; fonts.fontconfig.enable = true; diff --git a/modules/zsh.nix b/modules/zsh.nix index b24b0e7..e343214 100644 --- a/modules/zsh.nix +++ b/modules/zsh.nix @@ -36,6 +36,9 @@ in # Modern CLI tools ftp = "termscp"; + # Zoxide aliases + zi = "z -i"; # Interactive selection with fzf + # Nix helpers hm = "home-manager"; hms = "home-manager switch --flake ~/.config/nix#yanlin"; @@ -112,6 +115,9 @@ in ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(vi-add-eol) ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(vi-add-next) ZSH_AUTOSUGGEST_ACCEPT_WIDGETS=(end-of-line vi-end-of-line vi-add-eol) + + # Zoxide configuration - replace cd with z for smart directory jumping + eval "$(zoxide init zsh --cmd cd)" ''; }; @@ -130,6 +136,11 @@ in enableZshIntegration = true; }; + programs.zoxide = { + enable = true; + enableZshIntegration = true; + }; + # Manage Powerlevel10k configuration home.file.".p10k.zsh".source = ../config/p10k.zsh;