From c4a9376c0c0d9839772555e8cecc7142673bd642 Mon Sep 17 00:00:00 2001 From: skywind3000 Date: Fri, 15 Feb 2019 11:52:03 +0800 Subject: [PATCH] update doc for 1.5.1 --- README.cn.md | 20 ++++++++++++++++++++ README.md | 24 +++++++++++++++++++++++- 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/README.cn.md b/README.cn.md index a8fab76..8061395 100644 --- a/README.cn.md +++ b/README.cn.md @@ -341,6 +341,26 @@ alias zh='z -I -t .' 第一列数据代表该路径多少秒以前访问过,第二列是路径名称。此时,你可以试着敲几个字母,用 fzf 的字符串模糊匹配进行定位,或者用光标键的上和下(CTRL+J/K 也可以)来上下移动,最后按回车 cd 过去,或者 ESC 放弃。 +版本 `v1.5.1` 引入了模拟 "dir stack" 可以通过: `z -`,`z --` 和 `z -{num}` 来操作: + +```bash +# 显示当前的 dir stack +$ z -- + 0 /home/skywind/work/match/memory-match + 1 /home/skywind/.local/etc + 2 /home/skywind/software/vifm-0.9.1 + 3 /home/skywind/work + 4 /home/skywind/work/match + +# cd 到栈里 2 号路径 +$ z -2 + => cd /home/skywind/software/vifm-0.9.1 + +# 弹出栈顶 (cd 到上一次的老路径),和 "z -0" 相同 +$ z - + => cd - +``` + 注意:最好把增强匹配模式打开,这样查看历史路径时可以把当前路径过滤掉。 ## Tips diff --git a/README.md b/README.md index ebcc8c2..b614ef4 100644 --- a/README.md +++ b/README.md @@ -355,11 +355,32 @@ The new alias `zh` (jump to history) uses a parameter `-t` to sort the result by The first column indicates how many seconds ago you have visited, and the second column is the path name. With `zh`, you can type some character to use string matching in fzf, or use ``/`` (as well as `CTRL+j/k`) to move the selector (red `>`) up and down. -At last, press `` to accept or `` to give up. +At last, press `` to accept or `` to give up. + +Version `v1.5.1` has introduced a simulated "dir stack", which can be manipulated by `z -`, `z --` and `z -{num}`: + +```bash +# display current dir stack +$ z -- + 0 /home/skywind/work/match/memory-match + 1 /home/skywind/.local/etc + 2 /home/skywind/software/vifm-0.9.1 + 3 /home/skywind/work + 4 /home/skywind/work/match + +# cd to the 2nd directory in the stack +$ z -2 + => cd /home/skywind/software/vifm-0.9.1 + +# popup stacktop (cd to previous directory), same as "z -0" +$ z - + => cd - +``` Remember to enable the [enhanced matching](#enhanced-matching) algorithm, the current working directory can be skipped with it. + ## Tips Recommended aliases you may find useful: @@ -427,6 +448,7 @@ As you see, z.lua is the fastest one and requires less resource. ## History +- 1.5.1 (2019-02-15): new: simulated dir stack by `z -`, `z --` and `z -{num}`. - 1.5.0 (2019-02-14): fixed minor issues in backward jumping. - 1.4.7 (2019-02-13): Don't use regex in backward jumping (use plain text instead). - 1.4.6 (2019-02-12): change: `_ZL_EXCLUDE_DIRS` to a comma separated list of dirs to exclude.