Zoxide: Difference between revisions
Appearance
imported from old wiki |
changed the incorrect option 'flags' to 'options' according to the program documentation ttps://github.com/nix-community/home-manager/blob/d9a97e8b33227a6086538ac2d3d1960b03ed940c/modules/programs/zoxide.nix#L26-L2 |
||
| (5 intermediate revisions by 4 users not shown) | |||
| Line 1: | Line 1: | ||
{{DISPLAYTITLE:Zoxide}} | {{DISPLAYTITLE:Zoxide}} | ||
[https://github.com/ajeetdsouza/zoxide Zoxide] is a smarter | [https://github.com/ajeetdsouza/zoxide Zoxide] is a smarter ''cd'' (change directory) command that supports all major shells. | ||
== Installation == | == Installation == | ||
| Line 13: | Line 13: | ||
Change <code>myuser</code> to the username of the user you want to configure. | Change <code>myuser</code> to the username of the user you want to configure. | ||
It may also be necessary to add <code>zoxide</code> to <code>home.packages</code> if it hasn't already been installed by some other method: | |||
<syntaxhighlight lang="nix"> | |||
home.packages = with pkgs; [ | |||
zoxide | |||
]; | |||
</syntaxhighlight> | |||
== Shell Integration == | == Shell Integration == | ||
| Line 23: | Line 30: | ||
programs.zoxide.enableNushellIntegration = true; | programs.zoxide.enableNushellIntegration = true; | ||
programs.zoxide.enableZshIntegration = true; | programs.zoxide.enableZshIntegration = true; | ||
</syntaxhighlight> | |||
It may be necessary to also ensure that Home Manager can modify your rc file; for example, bash may require: | |||
<syntaxhighlight lang="nix> | |||
programs.bash.enable = true; | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 31: | Line 43: | ||
You can pass [https://github.com/ajeetdsouza/zoxide?tab=readme-ov-file#flags extra flags] to Zoxide using <code>programs.zoxide.options</code> as follows: | You can pass [https://github.com/ajeetdsouza/zoxide?tab=readme-ov-file#flags extra flags] to Zoxide using <code>programs.zoxide.options</code> as follows: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix">programs.zoxide.options = [ | ||
programs.zoxide.options = [ | |||
"--cmd cd" | "--cmd cd" | ||
]; | ];</syntaxhighlight> | ||
</syntaxhighlight> | |||
[[Category:Shell]] | |||
Latest revision as of 10:48, 17 November 2025
Zoxide is a smarter cd (change directory) command that supports all major shells.
Installation
A basic user-specific installation with Home Manager may look like this:
home-manager.users.myuser = {
programs.zoxide.enable = true;
};
Change myuser to the username of the user you want to configure.
It may also be necessary to add zoxide to home.packages if it hasn't already been installed by some other method:
home.packages = with pkgs; [
zoxide
];
Shell Integration
You can choose which shell integrations to enable with the enable*Integration options. By default all are enabled.
programs.zoxide.enableBashIntegration= true;
programs.zoxide.enableFishIntegration= true;
programs.zoxide.enableNushellIntegration = true;
programs.zoxide.enableZshIntegration = true;
It may be necessary to also ensure that Home Manager can modify your rc file; for example, bash may require:
programs.bash.enable = true;
After adding Zoxide, you will have to restart your shell to gain access to the z command.
Extra Options
You can pass extra flags to Zoxide using programs.zoxide.options as follows:
programs.zoxide.options = [
"--cmd cd"
];