Skip to content

Commit 8334b1a

Browse files
author
skywind3000
committed
update doc
1 parent f068e85 commit 8334b1a

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

README.cn.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ PS:你可以使用 `$_ZL_FZF` 环境变量来精确指明 fzf 的可执行路
263263

264264
`"-b"` 选项可以快速回到某一级父目录,避免重复的输入 "cd ../../.."。
265265

266-
- **(没有参数)**`cd` 到项目根目录,即跳转到父目录中包含 (.git/.svn/.hg) 的地方
266+
- **(没有参数)**`cd` 到项目根目录,即跳转到最近的包含 (.git/.svn/.hg) 的父目录
267267
- **(单个参数)**`cd` 到离当前目录最近的以关键字开头的父目录,如果找不到就尝试跳到包含关键字的父目录。
268268
- **(两个参数)**:将当前路径中的第一个关键词替换为第二个关键词。
269269

@@ -326,22 +326,7 @@ eval "$(lua /path/to/z.lua --init bash enhanced once echo fzf)"
326326

327327
## MRU
328328

329-
以往我们经常使用 `cd -` 命令来回到刚才访问过的目录,而有了 fzf 的帮助,我们可以更高效的来完成这件事情:
330-
331-
332-
```bash
333-
alias zh='z -I -t .'
334-
```
335-
336-
首先定义个新的别名 `zh`(回到历史路径的意思),我们使用了 `-t` 参数来告诉 `z.lua` 按照时间戳作为权重进行排序,同时 `-I` 启用 fzf 进行搜索,最后的句号代表任意路径。
337-
338-
那么当我们在命令行敲入 zh 时,就可以用 fzf 选择最近呆过的路径了:
339-
340-
![](images/mru.png)
341-
342-
第一列数据代表该路径多少秒以前访问过,第二列是路径名称。此时,你可以试着敲几个字母,用 fzf 的字符串模糊匹配进行定位,或者用光标键的上和下(CTRL+J/K 也可以)来上下移动,最后按回车 cd 过去,或者 ESC 放弃。
343-
344-
版本 `v1.5.1` 引入了模拟 `dirstack` 可以通过: `z -``z --``z -{num}` 来操作:
329+
`z.lua` 提供 `dirstack` 让你更便捷的访问最近刚刚去过的目录,而不需要输入任何关键字。这个方法叫做 `dirstack`,它记录着最近你刚刚去过的 10 条最新路径,然后是用 `z -``z --``z -{num}` 来操作:
345330

346331
```bash
347332
# 显示当前的 dir stack
@@ -363,6 +348,20 @@ $ z -
363348

364349
这个 `dirstack` 是根据 z.lua 的路径历史数据库计算的出来的,所以和具体的 shell 或者操作系统都没有关系。你退出再登陆不会丢失这些路径历史,不同的 shell 之间也可以共享同一份历史数据。
365350

351+
此外,还有另外一种方法,通过使用前面提到的 `-I``-t` 参数组和,可以使用 fzf 进行交互式选择:
352+
353+
```bash
354+
alias zh='z -I -t .'
355+
```
356+
357+
首先定义个新的别名 `zh`(回到历史路径的意思),我们使用了 `-t` 参数来告诉 `z.lua` 按照时间戳作为权重进行排序,同时 `-I` 启用 fzf 进行搜索,最后的句号代表任意路径。
358+
359+
那么当我们在命令行敲入 zh 时,就可以用 fzf 选择最近呆过的路径了:
360+
361+
![](images/mru.png)
362+
363+
第一列数据代表该路径多少秒以前访问过,第二列是路径名称。此时,你可以试着敲几个字母,用 fzf 的字符串模糊匹配进行定位,或者用光标键的上和下(CTRL+J/K 也可以)来上下移动,最后按回车 cd 过去,或者 ESC 放弃。
364+
366365
注意:最好把增强匹配模式打开,这样查看历史路径时可以把当前路径过滤掉。
367366

368367

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,7 @@ eval "$(lua /path/to/z.lua --init zsh once)"
243243
source (lua /path/to/z.lua --init fish once | psub)
244244
````
245245

246-
When `add once` mode is off (default), z.lua will consider the time you spent in the directory (like z.sh), and when this mode is on, z.lua will consider the times you accessed the directory (like autojump).
247-
248-
It could be much faster on slow hardware or Cygwin/MSYS.
246+
When `add once` mode is off (default), z.lua will consider the time you spent in the directory (like z.sh). When this mode is on, z.lua will consider the times you accessed the directory (like autojump), and tt could be much faster on slow hardware like RaspberryPi or Cygwin/MSYS.
249247

250248

251249
## Interactive Selection

0 commit comments

Comments
 (0)