Implement zoxide integration with neovim, override cd with zoxide as new cd command
This commit is contained in:
parent
05a9c38515
commit
2ffb0ba65b
|
|
@ -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
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue