-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add zoxide command to replace cd by terminal
- Loading branch information
1 parent
2eb2030
commit 49912d3
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# zoxide | ||
|
||
> **[zoxide](https://github.com/ajeetdsouza/zoxide) - 增强版 cd 工具** | ||
更聪明的 `cd` 命令,能够记住你最常使用的目录,从而让目录跳转更加方便和快捷。 | ||
|
||
![zoxide](../images/tools/tools-zoxide.gif) | ||
|
||
```bash | ||
# 安装对应工具(Ubuntu) | ||
$ sudo apt install zoxide | ||
|
||
# 安装对应工具(macOS) | ||
$ brew install zoxide | ||
|
||
# 补全 | ||
$ eval "$(zoxide init zsh)" | ||
$ eval "$(zoxide init bash)" | ||
``` | ||
|
||
```bash | ||
~ » zoxide --help | ||
zoxide v0.4.3-unknown | ||
A faster way to navigate your filesystem | ||
|
||
USAGE: | ||
zoxide <SUBCOMMAND> | ||
|
||
FLAGS: | ||
-h, --help Prints help information | ||
-V, --version Prints version information | ||
|
||
SUBCOMMANDS: | ||
add Add a new directory or increment its rank | ||
help Prints this message or the help of the given subcommand(s) | ||
import Import from z database | ||
init Generates shell configuration | ||
query Search for a directory | ||
remove Remove a directory | ||
``` | ||
|
||
```bash | ||
# z 目录 | ||
|
||
z foo # cd into highest ranked directory matching foo | ||
z foo bar # cd into highest ranked directory matching foo and bar | ||
z foo / # cd into a subdirectory starting with foo | ||
|
||
z ~/foo # z also works like a regular cd command | ||
z foo/ # cd into relative path | ||
z .. # cd one level up | ||
z - # cd into previous directory | ||
|
||
zi foo # cd with interactive selection (using fzf) | ||
|
||
z foo<SPACE><TAB> # show interactive completions (zoxide v0.8.0+, bash 4.4+/fish/zsh only) | ||
``` |