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

simplify doc

This commit is contained in:
skywind3000
2019-02-14 16:36:34 +08:00
parent 464a8ede51
commit 453cd40ed1
2 changed files with 2 additions and 40 deletions

View File

@@ -287,27 +287,7 @@ PS你可以使用 `$_ZL_FZF` 环境变量来精确指明 fzf 的可执行路
=> cd ~/github/ghost/test
```
向后跳转同样也支持环境变量 `$_ZL_ECHO`(用来显示跳转结果),这样搭配其他工具提供了可能性(并不需要改变当前工作目录):
```bash
# 假设我们位于 ~/github/vim/src/libvterm
# 打开 $_ZL_ECHO 用于在每次跳转后调用一次 pwd 显示当前目录
$ _ZL_ECHO=1
# 看看我项目根目录(有 .git 那个)目录里有什么?
$ ls -l `zb`
=> ls -l ~/github/vim
# 检查 "<项目根目录>/logs" 下面的日志
$ tail -f `zb`/logs/error.log
=> tail -f ~/github/vim/logs/error.log
# 查看一下某一级父目录里有些啥
$ ls -l `zb git`
=> ls -l ~/github
```
向后跳转同样也支持环境变量 `$_ZL_ECHO`(用来显示跳转结果),这样可以搭配其他工具,在目标目录内执行命令,而并不需要改变当前工作目录(比如:``ls `zb git` ``)。
**Bonus**`zb ..` 相当于 `cd ..``zb ...` 相当于 `cd ../..`,而 `zb ....` 相当于 `cd ../../..` 等等。 最后 `zb ..20` 等同于调用 `cd ..` 二十次。

View File

@@ -306,26 +306,8 @@ Let's start by aliasing `z -b` to `zb`:
=> cd ~/github/ghost/test
```
Backward jumping can also be used with `$_ZL_ECHO` option (echo $pwd), which makes it possible to combine them with other tools (without actually changing the working directory):
Backward jumping can also be used with `$_ZL_ECHO` option (echo $PWD after cd), which makes it possible to combine them with other tools without actually changing the working directory (eg. ``ls `zb git` ``).
```bash
# Assuming we are in ~/github/vim/src/libvterm
# Enable $_ZL_ECHO to emit a pwd command after cd
$ _ZL_ECHO=1
# see what's in my project root
$ ls -l `zb`
=> ls -l ~/github/vim
# check log in "<project root>/logs"
$ tail -f `zb`/logs/error.log
=> tail -f ~/github/vim/logs/error.log
# list some parent directory
$ ls -l `zb git`
=> ls -l ~/github
```
**Bonus**: `zb ..` equals to `cd ..`, `zb ...` equals to `cd ../..` and `zb ....` equals to `cd ../../..`, and so on. Finally, `zb ..20` equals to `cd (..)x20`.