1
0
mirror of https://github.com/skywind3000/z.lua synced 2026-03-15 12:19:49 +00:00

update doc

This commit is contained in:
skywind3000
2019-02-08 22:12:31 +08:00
parent 319dae8ade
commit b941e9eec1
2 changed files with 14 additions and 29 deletions

View File

@@ -263,21 +263,9 @@ PS你可以使用 `$_ZL_FZF` 环境变量来精确指明 fzf 的可执行路
`"-b"` 选项可以快速回到某一级父目录,避免重复的输入 "cd ../../.."。
- **(没有参数)** `cd` 到项目根目录
使用 `"z -b"` 后面不跟任何参数z.lua 会寻找当前项目的 checkout 目录(有 `.git`/`.hg`/`.svn` 的地方) 然后 `cd` 过去
- **(单个参数)** `cd` 到离当前目录最近的以关键字开头的父目录:
假设你在 `/home/user/project/src/org/main/site/utils/file/reader/whatever` 然后你想快速回到 `site` 目录,
只需要输入:`z -b site`
实际上,可简化为 `z -b <开头的几个字母>` 比如 `z -b s` 或者 `z -b si`。
如果当前存在多级父目录同时包含你输入的关键词,`z -b xxx` 会将你到离你最近的那一层父目录。
- **(两个参数)** 将当前路径中的第一个关键词替换为第二个关键词。
- **(没有参数)**`cd` 到项目根目录,即跳转到父目录中包含 (.git/.svn/.hg) 的地方。
- **(单个参数)**`cd` 到离当前目录最近的以关键字开头的父目录。
- **(两个参数)**:将当前路径中的第一个关键词替换为第二个关键词
为了使用简便,我们继续将 `z -b` 取个别名成 `zb`
@@ -290,6 +278,10 @@ PS你可以使用 `$_ZL_FZF` 环境变量来精确指明 fzf 的可执行路
~/github/vimium/src/public$ zb g
=> cd ~/github
# 快速回到 site 目录
~/github/demo/src/org/main/site/utils/file/reader/whatever$ zb si
=> cd ~/github/demo/src/org/main/site
# 将 jekyll 替换为 ghost
~/github/jekyll/test$ zb jekyll ghost
=> cd ~/github/ghost/test

View File

@@ -277,20 +277,9 @@ NOTE: For fish shell, this feature requires fish 2.7.0 or above. You can specify
New option `"-b"` can quickly go back to a specific parent directory in bash instead of typing "cd ../../.." redundantly.
- **(No argument)** `cd` into the project root:
Use `z -b` with no argument, it will look for the project (checkout) directory (the one with `.git`/`.hg`/`.svn` in it) and then `cd` into it.
- **(One argument)** `cd` into the closest parent having its name begin with whatever the value you passed in:
If you are in this path `/home/user/project/src/org/main/site/utils/file/reader/whatever` and you want to go to `site` directory quickly,
then just type: `z -b site`
In fact, You can simply type `z -b <starting few letters>` like `z -b s` or `z -b si`.
If there are more than one directories with same name up in the hierarchy, `z -b` will take you to the closest.
- **(Two arguments)** replace the first value with the second one (in the current path).
- **(No argument)**: `cd` into the project root, the project root is one of the parent directory with `.git`/`.hg`/`.svn` in it
- **(One argument)**: `cd` into the closest parent having its name begin with the keyword you passed in.
- **(Two arguments)**: replace the first value with the second one (in the current path).
Let's start by aliasing `z -b` to `zb`:
@@ -303,6 +292,10 @@ Let's start by aliasing `z -b` to `zb`:
~/github/vimium/src/public$ zb g
=> cd ~/github
# goto the site directory quickly
~/github/demo/src/org/main/site/utils/file/reader/whatever$ zb si
=> cd ~/github/demo/src/org/main/site
# substitute jekyll with ghost
~/github/jekyll/test$ zb jekyll ghost
=> cd ~/github/ghost/test