refactor: finish moving ssh-* scripts to own installers
[webi-installers/.git] / zoxide / README.md
1 ---
2 title: zoxide
3 homepage: https://github.com/ajeetdsouza/zoxide
4 tagline: |
5   zoxide: A smarter cd command.
6 ---
7
8 ## Cheat Sheet
9
10 `zoxide` is a smarter `cd` command for your terminal. It keeps track of the
11 directories you visit, so that you can switch to them using just a few
12 keystrokes.
13
14 ![tutorial](https://github.com/ajeetdsouza/zoxide/raw/main/contrib/tutorial.webp)
15
16 ## Usage
17
18 ```sh
19 z foo       # cd to highest ranked directory matching foo
20 z foo bar   # cd to highest ranked directory matching foo and bar
21
22 z foo/      # can also cd into actual directories
23 z ..        # cd into parent directory
24 z -         # cd into previous directory
25
26 zi foo      # cd with interactive selection (requires fzf)
27 ```
28
29 ## Add zoxide to your shell
30
31 To use zoxide, it needs to be first initialized on your shell:
32
33 ### `bash`
34
35 Add this to your configuration (usually `~/.bashrc`):
36
37 ```sh
38 eval "$(zoxide init bash)"
39 ```
40
41 ### `elvish`
42
43 Add this to your configuration (usually `~/.elvish/rc.elv`):
44
45 ```sh
46 eval (zoxide init elvish | slurp)
47 ```
48
49 ### `fish`
50
51 Add this to your configuration (usually `~/.config/fish/config.fish`):
52
53 ```fish
54 zoxide init fish | source
55 ```
56
57 ### `nushell 0.32.0+`
58
59 Initialize zoxide's Nushell script:
60
61 ```sh
62 zoxide init nushell --hook prompt | save ~/.zoxide.nu
63 ```
64
65 Add this to your configuration (usually `~/.config/nu/config.toml`):
66
67 ```toml
68 prompt = "__zoxide_hook;__zoxide_prompt"
69 startup = ["zoxide init nushell --hook prompt | save ~/.zoxide.nu", "source ~/.zoxide.nu"]
70 ```
71
72 You can replace `__zoxide_prompt` with a custom prompt.
73
74 ### `powershell`
75
76 Add this to your configuration (the location is stored in `$profile`):
77
78 ```powershell
79 Invoke-Expression (& {
80     $hook = if ($PSVersionTable.PSVersion.Major -lt 6) { 'prompt' } else { 'pwd' }
81     (zoxide init --hook $hook powershell) -join "`n"
82 })
83 ```
84
85 ### `xonsh`
86
87 Add this to your configuration (usually `~/.xonshrc`):
88
89 ```python
90 execx($(zoxide init xonsh), 'exec', __xonsh__.ctx, filename='zoxide')
91 ```
92
93 ### `zsh`
94
95 Add this to your configuration (usually `~/.zshrc`):
96
97 ```sh
98 eval "$(zoxide init zsh)"
99 ```
100
101 ### Any POSIX shell
102
103 Add this to your configuration:
104
105 ```sh
106 eval "$(zoxide init posix --hook prompt)"
107 ```