diff --git a/global-home.nix b/global-home.nix index be4b79b8..e32e7001 100644 --- a/global-home.nix +++ b/global-home.nix @@ -59,6 +59,14 @@ else builtin cd "''${HOME}" && printf "\033]7;file://''${PWD}\033\\" fi '') + # Version for zoxide + (pkgs.writeShellScriptBin "z-nvim" '' +if [ "$1" ]; then + z-builtin "''${1}" && printf "\033]7;file://''${PWD}\033\\" +else + z-builtin "''${HOME}" && printf "\033]7;file://''${PWD}\033\\" +fi + '') # wineWowPackages.full # native wayland support (unstable) @@ -307,13 +315,18 @@ fi # bashrcExtra = "fastfetch"; initExtra = '' . "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" + eval "$(zoxide init bash --cmd z-builtin)" # Initialise zoxide as terminal command z-builtin ([[ -z $(tty) ]] && nvim +terminal) || fastfetch ''; shellAliases = { sudo = "sudo "; doas = "doas "; edit = "$EDITOR"; - cd = "source cd-nvim"; + + # Override the default cd and z (zoxide) terminal commands to ensure to add our custom hooks onto it for neovim integration + #cd = "source cd-nvim"; + z = "source z-nvim"; + cd = "source z-nvim"; # Now will use z (zoxide) as the default cd command instead }; };